[wp-trac] [WordPress Trac] #16593: wp_set_object_terms not creating links when in a save_post action

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 25 19:25:52 UTC 2011


#16593: wp_set_object_terms not creating links when in a save_post action
-------------------------------+------------------------------
 Reporter:  grandslambert      |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  3.0.5
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by grandslambert):

 For what it's worth, I have deteremined that my save_post action only
 appears to run when saving revisions, as the $post_id I get in the action
 is not the same as the post ID for the post I just edited. Within the save
 action I call a function

 {{{
 $this->save_ingredients($post_id, $_POST['ingredients']);
 }}}

 Which sends the revision post ID and not the actual post ID. So, I
 modified my save_ingredients function to apply the objects to both the
 $post_id sent to the function, and the global $post->ID and this seems to
 work. I use several 'add_post_meta' calls and they all work, but if I send
 the $post_id to my own function, it does not.

 Why does the save action only have the revision ID and not the post ID? Is
 this the intended result?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16593#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list