Filter hook 'pre_trash_post'

in WP Core File wp-includes/post.php at line 3742

Description

Filters whether a post trashing should take place.

Occurrences

Filename Line Number
wp-includes/post.php 3742
wp-includes/class-wp-customize-manager.php 3090

Parameters

Type Name Description
bool|null $trash Whether to go forward with trashing.
WP_Post $post Post object.
string $previous_status The status of the post about to be trashed.

PHP Doc

/**
	 * Filters whether a post trashing should take place.
	 *
	 * @since 4.9.0
	 * @since 6.3.0 Added the `$previous_status` parameter.
	 *
	 * @param bool|null $trash           Whether to go forward with trashing.
	 * @param WP_Post   $post            Post object.
	 * @param string    $previous_status The status of the post about to be trashed.
	 */