delete_post
The WordPress Core delete post hook.
Description
Parameters (1)
- 0. $wp_delete_post_menu_item (string) =>
'_wp_delete_post_menu_item'
- The
wp
delete post menu item.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'delete_post', $wp_delete_post_menu_item );
- The following example is for adding a hook callback.
- // define the delete_post callback
- function action_delete_post( $wp_delete_post_menu_item ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'delete_post', 'action_delete_post', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'delete_post', 'action_delete_post', 10, 1 );
Defined (6)
The action is defined in the following location(s).
- /wp-includes/default-filters.php
- add_action( 'delete_post', '_wp_delete_post_menu_item' );
- add_action( 'delete_post', 'delete_get_calendar_cache' );
- /wp-includes/ms-default-filters.php
- add_action( 'delete_post', '_update_posts_count_on_delete' );
- add_action( 'delete_post', '_update_blog_date_on_post_delete' );
- /wp-includes/post.php
- do_action( 'delete_post', $postid );
- do_action( 'delete_post', $post_id );