wp2.6 passing wrong post ids in the functions called by actions publish_post,
-
hi
I have a plugin which I am using for adding thumbnails for each post.It adds a file type field to the post screen andn when the post is saved/created/published it stores the image file in a folder and does it’s entry in database.I am using following actions
add_action(“publish_post”,’save_post_image’);
add_action(“wp_insert_post”,’save_post_image’);
add_action(“save_post”,’save_post_image’);and the function save_post_image is written like
function save_post_image($post_id)
{
//perform some action
}Now the real problem is,the $post_id contains the wrong id of the post which is passed by the action hook .
I wordpress 2.3 and 2.5 it was containing correct post id.
but in wordpress 2.6 the behavior is strange.If I am creating a post with id=21 then the passed variable contains $post_id=22,I don’t know where is the issue.Please help.
- The topic ‘wp2.6 passing wrong post ids in the functions called by actions publish_post,’ is closed to new replies.