W3cubDocs

/WordPress

do_action( ‘wp_trash_post’, int $post_id, string $previous_status )

Fires before a post is sent to the Trash.

Parameters

$post_idint
Post ID.
$previous_statusstring
The status of the post about to be trashed.

Source

do_action( 'wp_trash_post', $post_id, $previous_status );

Changelog

Version Description
6.3.0 Added the $previous_status parameter.
3.3.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_trash_post