WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
событие не описано

(new_status)_(post_type) хук-событие . WP 2.3.0

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

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

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

Possible hook names include:

  • draft_post
  • future_post
  • pending_post
  • private_post
  • publish_post
  • trash_post
  • draft_page
  • future_page
  • pending_page
  • private_page
  • publish_page
  • trash_page
  • publish_attachment
  • trash_attachment

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_2608', 10, 2 );
function action_function_name_2608( $post_id, $post ){
	// action...
}
$post_id(int)
Post ID.
$post(WP_Post)
Post object.

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

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

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

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

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

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