'post_title' => $filename,
'post_content' => $url,
'post_mime_type' => $type,
- 'guid' => $url);
+ 'guid' => $url,
+ 'context' => 'custom-header');
// Save the data
$id = wp_insert_attachment($object, $file);
'post_title' => basename($cropped),
'post_content' => $url,
'post_mime_type' => 'image/jpeg',
- 'guid' => $url
+ 'guid' => $url,
+ 'context' => 'custom-header'
);
// Update the attachment