pre_trash_post WordPress Filter Hook

The pre_trash_post hook is called before a post is sent to the trash. This hook can be used to perform any actions that need to happen before a post is deleted, such as cleaning up associated data or sending a notification to the author.

apply_filters( 'pre_trash_post', bool|null $trash, WP_Post $post ) #

Filters whether a post trashing should take place.


Parameters

$trash

(bool|null)Whether to go forward with trashing.

$post

(WP_Post)Post object.


Top ↑

Source

File: wp-includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More