Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#55687 closed defect (bug) (invalid)

"{$new_status}_{$post->post_type}" publish status doesn't fire after deleted post republished from restore'd draft

Reported by: majemedia's profile majemedia Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.9.3
Component: Posts, Post Types Keywords:
Focuses: administration Cc:



  1. set a method to watch for publish status as new status in the {$new_status}_{$post->post_type} action.
  2. Move a post to trash
  3. Restore post (gets set to draft status)
  4. Set the post's status to publish (via quick edit, post edit, bulk edit, doesn't matter). Also the screen view doesn't matter (all, draft, mine, etc)


  1. Action doesn't fire.

I haven't tested the other two actions in that method (this is the last one in the list). I tested this on a custom post type.


  • WP: 5.9.3
  • Theme: seems agnostic but tested on twenttwentytwo
  • Plugins: none (except for the one made to test the action)
  • PHP: 7.4

Change History (3)

#1 @majemedia
2 years ago

I should have noted that it DOES fire in all other circumstances except for the trash->draft->publish path.

#2 @majemedia
2 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Closing as invalid. I found the reason... and the reason was me.

#3 @peterwilsoncc
2 years ago

  • Milestone Awaiting Review deleted

Thanks so much for following up.

Note: See TracTickets for help on using tickets.