untrashed_post action-hookWP 2.9.0

Fires after a post is restored from the Trash.

Usage

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(string)
The status of the post at the point where it was trashed.

Changelog

Since 2.9.0 Introduced.
Since 5.6.0 The $previous_status parameter was added.

Where the hook is called

wp_untrash_post()
untrashed_post
wp-includes/post.php 3692
do_action( 'untrashed_post', $post_id, $previous_status );

Where the hook is used in WordPress

Usage not found.