W3cubDocs

/WordPress

do_action( “deleted_post_{$post->post_type}”, int $post_id, WP_Post $post )

Fires immediately after a post is deleted from the database.

Description

The dynamic portion of the hook name, $post->post_type, refers to the post type slug.

Parameters

$post_idint
Post ID.
$postWP_Post
Post object.

Source

do_action( "deleted_post_{$post->post_type}", $post_id, $post );

Changelog

Version Description
6.6.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/deleted_post_post-post_type