W3cubDocs

/WordPress

apply_filters( ‘pre_trash_post’, bool|null $trash, WP_Post $post, string $previous_status )

Filters whether a post trashing should take place.

Parameters

$trashbool|null
Whether to go forward with trashing.
$postWP_Post
Post object.
$previous_statusstring
The status of the post about to be trashed.

Source

$check = apply_filters( 'pre_trash_post', null, $post, $previous_status );

Changelog

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

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