Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_transition_post_status [ WordPress Function ]

wp_transition_post_status ( $new_status, $old_status, $post )
Parameters:
  • (string) $new_status Transition to this post status.
  • (string) $old_status Previous post status.
  • (object) $post Post data.
Uses:
Links:
Defined at:



Transition the post status of a post.

Calls hooks to transition post status.

The first is 'transition_post_status' with new status, old status, and post data.

The next action called is 'OLDSTATUS_to_NEWSTATUS' the 'NEWSTATUS' is the $new_status parameter and the 'OLDSTATUS' is $old_status parameter; it has the post data.

The final action is named 'NEWSTATUS_POSTTYPE', 'NEWSTATUS' is from the $new_status parameter and POSTTYPE is post_type post data.

Source


<?php
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);
    
do_action("{$new_status}_{$post->post_type}"$post->ID$post);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics