Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/delete attachment


This hook is called when an attachment is deleted by wp_delete_attachment() in wp-includes/post.php.

Up to and including WordPress 2.7 it is fired after the attachment is deleted from the database and the file system, limiting its usefulness. As of changeset #10400 (WordPress 2.8), the action will fire before anything is deleted.


(integer) (required) The ID of the attachment being deleted.
Default: None