wphooks.info - untrash_post

untrash_post

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-includes/post.php:
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
		return $check;
	}

	/**
	 * Fires before a post is restored from the trash.
	 *
	 * @since 2.9.0
	 *
	 * @param int $post_id Post ID.
	 */
	do_action( 'untrash_post', $post_id );

	$post_status = get_post_meta( $post_id, '_wp_trash_meta_status', true );

	delete_post_meta( $post_id, '_wp_trash_meta_status' );
	delete_post_meta( $post_id, '_wp_trash_meta_time' );

	wp_update_post( array( 'ID' => $post_id, 'post_status' => $post_status ) );

	wp_untrash_post_comments( $post_id );