WordPress at a glance
action is not described

(new_status)_(post_type) action-hook . WP 2.3.0

Fires when a post is transitioned from one status to another.

The dynamic portions of the hook name, $new_status and $post->post_type, refer to the new post status and post type, respectively.

Please note: When this action is hooked using a particular post status (like 'publish', as publish_{$post->post_type}), it will fire both when a post is first transitioned to that status from something else, as well as upon subsequent post updates (old and new status are both the same).

Therefore, if you are looking to only fire a callback when a post is first transitioned to a status, use the 'transition_post_status' hook instead.


add_action( '(new_status)_(post_type)', 'action_function_name_592', 10, 2 );
function action_function_name_592( $post_id, $post ){
	// action...
Post ID.
Post object.


Since 2.3.0 Introduced.

Where the hook is called

wp-includes/post.php 4846
do_action( "{$new_status}_{$post->post_type}", $post->ID, $post );

Where in WP core the hook is used WordPress

Usage not found.