diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 48fe341655..626af6055c 100644
a
|
b
|
function wp_delete_attachment( $post_id, $force_delete = false ) { |
5605 | 5605 | return wp_trash_post( $post_id ); |
5606 | 5606 | } |
5607 | 5607 | |
| 5608 | /** |
| 5609 | * Filters whether an attachment deletion should take place. |
| 5610 | * |
| 5611 | * @since 5.5.0 |
| 5612 | * |
| 5613 | * @param bool|null $delete Whether to go forward with deletion. |
| 5614 | * @param WP_Post $post Post object. |
| 5615 | * @param bool $force_delete Whether to bypass the Trash. |
| 5616 | */ |
| 5617 | $check = apply_filters( 'pre_delete_attachment', null, $post, $force_delete ); |
| 5618 | if ( null !== $check ) { |
| 5619 | return $check; |
| 5620 | } |
| 5621 | |
5608 | 5622 | delete_post_meta( $post_id, '_wp_trash_meta_status' ); |
5609 | 5623 | delete_post_meta( $post_id, '_wp_trash_meta_time' ); |
5610 | 5624 | |