wp_transition_post_status

Definition:
function wp_transition_post_status($new_status, $old_status, $post) {}

Transition the post status of a post.
Calls hooks to transition post status.

Parameters

  • string $new_status: Transition to this post status.
  • string $old_status: Previous post status.
  • object $post: Post data.

Defined actions

  • transition_post_status
    do_action('transition_post_status', $new_status, $old_status, $post);
  • {$old_status}_to_{$new_status}
    do_action("{$old_status}_to_{$new_status}", $post);

Source code

function wp_transition_post_status($new_status, $old_status, $post) {

	do_action('transition_post_status', $new_status, $old_status, $post);

	do_action("{$old_status}_to_{$new_status}", $post);

4181

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: