pending_to_draft action-hookWP 2.3.0

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

The dynamic portions of the hook name, $new_status and $old_status, refer to the old and new post statuses, respectively.

This is one of the variants of the dynamic hook (old_status)_to_(new_status)

Usage

add_action( 'pending_to_draft', 'wp_kama_pending_to_draft_action' );

/**
 * Function for `pending_to_draft` action-hook.
 * 
 * @param WP_Post $post Post object.
 *
 * @return void
 */
function wp_kama_pending_to_draft_action( $post ){

	// action...
}
$post(WP_Post)
Post object.

Changelog

Since 2.3.0 Introduced.

Where the hook is called

wp_transition_post_status()
pending_to_draft
wp-includes/post.php 5476
do_action( "{$old_status}_to_{$new_status}", $post );

Where the hook is used in WordPress

Usage not found.