before_delete_post action-hook . WP 3.2.0
Fires before a post is deleted, at the start of wp_delete_post().
Usage
add_action( 'before_delete_post', 'action_function_name_2233', 10, 2 ); function action_function_name_2233( $postid, $post ){ // action... }
- $postid(int)
- Post ID.
- $post(WP_Post)
- Post object.
Changelog
Since 3.2.0 | Introduced. |
Since 5.5.0 | Added the $post parameter. |
Where the hook is called
wp-includes/post.php 3038
do_action( 'before_delete_post', $postid, $post );
Where in WP core the hook is used WordPress
wp-includes/default-filters.php 497
add_action( 'before_delete_post', '_reset_front_page_settings_for_post' );