[wp-trac] [WordPress Trac] #19074: 'transition_post_status' is executed before 'save_post'

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 7 18:16:39 UTC 2011

#19074: 'transition_post_status' is executed before 'save_post'
 Reporter:  M66B          |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Post Types    |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:                |
Changes (by M66B):

 * status:  closed => reopened
 * resolution:  invalid =>


 I have tested it again and it is really like this:

 '''Regular post type''': ''save_post'', then ''transition_post_status''
 and another ''save_post''

 '''Custom post types''': ''transition_post_status'', then ''save_post''

 Maybe ''wp_insert_post'' does it the right way, but the fact remains the
 order is different for custom post types.

   You'll need to check your checkbox on transition_post_status in order to
 have the value ready for those hooks

 The checkbox is checked in ''transition_post_status'' already, but the
 problem is that this works for the regular post type, but not for custom
 post types, because of the order the hooks are called.

Ticket URL: <http://core.trac.wordpress.org/ticket/19074#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list