pre_delete_attachment WordPress Filter Hook

The pre_delete_attachment hook is called before an attachment is deleted from the database. This hook can be used to perform any actions that need to be taken before an attachment is deleted.

apply_filters( 'pre_delete_attachment', WP_Post|false|null $delete, WP_Post $post, bool $force_delete ) #

Filters whether an attachment deletion should take place.


Parameters

$delete

(WP_Post|false|null)Whether to go forward with deletion. @TODO description

$post

(WP_Post)Post object.

$force_delete

(bool)Whether to bypass the Trash.


Top ↑

Source

File: wp-includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.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