deleted_post хук-событиеWP 2.2.0

Fires immediately after a post is deleted from the database.

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

add_action( 'deleted_post', 'wp_kama_deleted_post_action', 10, 2 );

/**
 * Function for `deleted_post` action-hook.
 * 
 * @param int     $postid Post ID.
 * @param WP_Post $post   Post object.
 *
 * @return void
 */
function wp_kama_deleted_post_action( $postid, $post ){

	// action...
}
$postid(int)
Post ID.
$post(WP_Post)
Post object.

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

С версии 2.2.0 Введена.
С версии 5.5.0 Added the $post parameter.

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

wp_delete_post()
deleted_post
wp_delete_attachment()
deleted_post
wp-includes/post.php 3459
do_action( 'deleted_post', $postid, $post );
wp-includes/post.php 6405
do_action( 'deleted_post', $post_id, $post );

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

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