I wrote a plugin, which used:
add_post_meta( $post_id, ‘_thumbnail_id’, $attach_id );
to set the featured image for a custom post in my property website.
This was working really well for over a year. I recently updated to wordpress 3.5.1 and it stopped working. No error message, just no featured image being set for the post.
$attach_id = media_sideload_image($file, $post_id, $desc = ‘property for sale’, $return_html = false);
to get the id of the image I wanted to use.
I have tried using add_post_meta and set_post_thumbnail, but neither work.
Has anyone else had this problem and found an answer?
- The topic ‘set featured image using update_post_meta stopped working 3.5.1’ is closed to new replies.