Make WordPress Core

Opened 6 years ago

Last modified 2 years ago

#36181 new enhancement

wp_transition_post_status after save post action

Reported by: sebastian.pisula Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch close
Focuses: Cc:


I want save all post meta to file when post was published. I use publish_post action that I haven't post meta because post meta was saved in save_post action.

I know that I can use save_post to save all post meta to file but I think that action publish_post is better. So we must move

wp_transition_post_status( $data['post_status'], $previous_status, $post );


return $post_ID;

I think that this is appropriate position for this function.

Attachments (1)

36181.patch (911 bytes) - added by sebastian.pisula 6 years ago.

Download all attachments as: .zip

Change History (3)

#1 @sebastian.pisula
6 years ago

  • Keywords has-patch added

#2 @swissspidy
6 years ago

  • Keywords close added

Developers hooking onto save_post and wp_insert_post can rely on wp_transition_post_status() being run. This patch changes that by running it after the hooks have been executed.

I'm sure this would break lots of things and therefore I don't see any reason to implement this.

Note: See TracTickets for help on using tickets.