Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

WordPress hook directory
delete_attachment

Description

Runs just before an attached file is deleted from the database. Action function arguments: attachment ID. (Prior to version 2.8 this hook was triggered after attachment was deleted.)

This description was scraped automatically from the WordPress filter reference or action reference. If it looks like this is the wrong description, please tell me so I can fix my code.

WordPress version history for delete_attachment

This database has information for all major versions from WP 1.2.1 through 5.1.

Version File Line Type
2.0 wp-includes/functions-post.php 380 View in context action
2.0.11 wp-includes/functions-post.php 384 View in context action
2.1 wp-includes/post.php 1401 View in context action
2.2 wp-includes/post.php 1407 View in context action
2.3 wp-includes/post.php 1454 View in context action
2.5 wp-includes/post.php 2199 View in context action
2.6 wp-includes/post.php 2334 View in context action
2.7 wp-includes/post.php 2476 View in context action
2.8 wp-includes/post.php 2593 View in context action
2.9 wp-includes/post.php 2852 View in context action
3.0 wp-includes/post.php 3458 View in context action
3.1 wp-includes/post.php 3700 View in context action
3.2 wp-includes/post.php 3785 View in context action
3.3 wp-includes/post.php 3782 View in context action
3.4 wp-includes/post.php 3835 View in context action
3.5 wp-includes/post.php 4091 View in context action
3.6 wp-includes/post.php 4072 View in context action
3.7 wp-includes/post.php 4168 View in context action
3.8 wp-includes/post.php 4175 View in context action
3.9 wp-includes/post.php 4655 View in context action
4.0 wp-includes/post.php 4785 View in context action
4.1 wp-includes/post.php 4783 View in context action
4.2 wp-includes/post.php 4831 View in context action
4.3 wp-includes/post.php 4909 View in context action
4.4 wp-includes/post.php 4717 View in context action
4.5 wp-includes/post.php 4868 View in context action
4.6 wp-includes/post.php 4770 View in context action
4.7 wp-includes/post.php 4887 View in context action
4.8 wp-includes/post.php 4892 View in context action
4.9 wp-includes/post.php 4970 View in context action
5.0 wp-includes/post.php 5140 View in context action
5.1 wp-includes/post.php 5419 View in context action

Related Hooks

We find related hooks using word stems. delete_attachment has 2 significant word stem(s): delete, attachment. Note that some of the hooks below may not appear in all versions of WP.