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

In this article

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

VersionDescription
6.3.0Added the $previous_status parameter.
4.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.