Fires before a post is sent to the Trash.
$post_idint$previous_statusstringwp-includes/class-wp-customize-manager.php:3097WP_Customize_Manager::trash_changeset_post()wp-includes/post.php:4048wp_trash_post() * @since 3.3.0 * @since 6.3.0 Added the `$previous_status` parameter. * * @param int $post_id Post ID. * @param string $previous_status The status of the post about to be trashed. */ do_action( 'wp_trash_post', $post_id, $previous_status ); add_post_meta( $post_id, '_wp_trash_meta_status', $previous_status ); add_post_meta( $post_id, '_wp_trash_meta_time', time() ); $post_updated = wp_update_post( array(Introduced in 3.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.