pre_delete_attachment

pre_delete_attachment

Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('pre_delete_attachment') is found 1 times:

  • /wp-includes/post.php line 6577
    6573
    6574
    6575
    6576
    6577
    6578
    6579
    6580
    6581
    6582
    6583
    * @param WP_Post|false|null $delete       Whether to go forward with deletion.
     * @param WP_Post            $post         Post object.
     * @param bool               $force_delete Whether to bypass the Trash.
     */
    $check = apply_filters( 'pre_delete_attachment', null, $post, $force_delete );
    if ( null !== $check ) {
        return $check;
    }
     
    delete_post_meta( $post_id, '_wp_trash_meta_status' );
    delete_post_meta( $post_id, '_wp_trash_meta_time' );

See this hook used in plugins: