简体   繁体   中英

update_post_meta to add featured image to post no longer works after update to wordpress 3.5.1

I have written a plugin which uses :

add_post_meta( $post_id, '_thumbnail_id', $attach_id );

To set the featured image for a post. This plugin has been working nicely for over a year. I updated to wordpress 3.5.1 and it no longer works. No featured image is set.

I have tried using add_post_meta and set_post thumbnail, but to no avail. Has any one else had this problem and most importantly, does any one know what to do to solveit?

I was looking for a solution to set the featured image on a post, I am using

update_post_meta($post_id, '_thumbnail_id', $attach_id);

and it works just fine for me hope you get similar luck.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM