pre_trash_post

pre_trash_post

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('pre_trash_post') is found 2 times:

  • /wp-includes/class-wp-customize-manager.php line 3090
    3087
    3088
    3089
    3090
    3091
    3092
    3093
    3094
    3095
    3096
    $previous_status = $post->post_status;
     
    /** This filter is documented in wp-includes/post.php */
    $check = apply_filters( 'pre_trash_post', null, $post, $previous_status );
    if ( null !== $check ) {
        return $check;
    }
     
    /** This action is documented in wp-includes/post.php */
    do_action( 'wp_trash_post', $post_id, $previous_status );
  • /wp-includes/post.php line 3911
    3907
    3908
    3909
    3910
    3911
    3912
    3913
    3914
    3915
    3916
    3917
    * @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.
     */
    $check = apply_filters( 'pre_trash_post', null, $post, $previous_status );
     
    if ( null !== $check ) {
        return $check;
    }
     
    /**

See this hook used in plugins: