Action hook 'delete_attachment'

in WP Core File wp-includes/post.php at line 6433

Description

Fires before an attachment is deleted, at the start of wp_delete_attachment().

Occurrences

Filename Line Number
wp-includes/post.php 6433

Parameters

Type Name Description
int $post_id Attachment ID.
WP_Post $post Post object.

PHP Doc

/**
	 * Fires before an attachment is deleted, at the start of wp_delete_attachment().
	 *
	 * @since 2.0.0
	 * @since 5.5.0 Added the `$post` parameter.
	 *
	 * @param int     $post_id Attachment ID.
	 * @param WP_Post $post    Post object.
	 */