[wp-trac] [WordPress Trac] #8792: Transitions should be called even if the status hasn't changed

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 3 22:06:07 GMT 2009


#8792: Transitions should be called even if the status hasn't changed
--------------------------+-------------------------------------------------
 Reporter:  nbachiyski    |       Owner:  anonymous
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  2.8      
Component:  General       |     Version:  2.7      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------
 I wanted to be able to differentiate newly published posts and published
 posts, which are re-saved. The current transitions hooks  offer either:
  * {{{publish_post}}} hook, which is called for all saves of published
 posts
 or
  * {{{oldstatus_to_publish}}} hook, which is called only if the status has
 changed.
 Thus, there is no way to hook to the case, in which the status hasn't
 changed.

 The logical solution for me is to make all the hooks in
 {{{wp_transition_post_status()}}} to be called even if the status hasn't
 changed. It shouldn't cause any compatibility problems, so here is a
 patch.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8792>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list