Fires immediately before a post is deleted from the database.
$post_idint$postWP_Postwp-includes/post.php:3907wp_delete_post()wp-includes/post.php:6764wp_delete_attachment() * @since 1.2.0 * @since 5.5.0 Added the `$post` parameter. * * @param int $post_id Post ID. * @param WP_Post $post Post object. */ do_action( 'delete_post', $post_id, $post ); $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) ); if ( ! $result ) { return false; }Introduced in 1.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.