untrashed_post
Fires after a post is restored from the Trash.
Использование
add_action( 'untrashed_post', 'wp_kama_untrashed_post_action', 10, 2 ); /** * Function for `untrashed_post` action-hook. * * @param int $post_id Post ID. * @param string $previous_status The status of the post at the point where it was trashed. * * @return void */ function wp_kama_untrashed_post_action( $post_id, $previous_status ){ // action... }
- $post_id(int)
- Post ID.
- $previous_status(строка)
- The status of the post at the point where it was trashed.
Список изменений
С версии 2.9.0 | Введена. |
С версии 5.6.0 | Added the $previous_status parameter. |
Где вызывается хук
wp-includes/post.php 4053
do_action( 'untrashed_post', $post_id, $previous_status );