(old_status)_to_(new_status) хук-событие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 $old_status, refer to the old and new post statuses, respectively.

Possible hook names include:

Использование

add_action( '(old_status)_to_(new_status)', 'wp_kama_old_status_to_new_action' );

/**
 * Function for `(old_status)_to_(new_status)` action-hook.
 * 
 * @param WP_Post $post Post object.
 *
 * @return void
 */
function wp_kama_old_status_to_new_action( $post ){

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

Список изменений

С версии 2.3.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.