Skip to content

Instantly share code, notes, and snippets.

View EngKhaledB's full-sized avatar
🏠
Working from home

Khaled Abu Alqomboz EngKhaledB

🏠
Working from home
View GitHub Profile
@Ruzgfpegk
Ruzgfpegk / wp-perf.md
Last active August 22, 2024 20:53
WordPress Performance & Development tips
@NguyenDa18
NguyenDa18 / lightning-talk.md
Last active December 25, 2018 08:15
PdxNode Resources

Learning Resources: Web Dev, APIs, DevOps, Machine Learning

Web Learning Resources

@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,