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


Staff member
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?