WordPress.org

Ready to get started?Download WordPress

Forums

set featured image using update_post_meta stopped working 3.5.1 (1 post)

  1. Karen Turner
    Member
    Posted 1 year ago #

    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.
    I used:
    $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?

Topic Closed

This topic has been closed to new replies.

About this Topic