[wp-trac] [WordPress Trac] #34715: transition_post_status does not fire when untrashing a post

WordPress Trac noreply at wordpress.org
Tue Nov 17 16:55:15 UTC 2015


#34715: transition_post_status does not fire when untrashing a post
-------------------------------+-----------------------------
 Reporter:  SeBsZ              |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  4.3.1
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 transition_post_status does not fire when untrashing a published custom
 post.

 I've got an action added as follows:
 {{{#!php
 <?php
 add_action('transition_post_status', 'my_transition', 10, 3);
 }}}

 When I trash a drafted custom post, the function is fired with old=draft
 and new=trash. If I then undo the trash action, the function is correctly
 fired with old=trash and new=draft. If we then repeat the experiment with
 a published post, and we trash it the function fires with old=publish and
 new=trash. If we now undo the action, the function does NOT fire at all,
 where it should have fired with old=trash and new=publish.

 I've noticed this with a custom post type. This does NOT happen with the
 default post type.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34715>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list