wp_trash_post

The WordPress Core wp trash post hook.

Description

add_action( 'wp_trash_post', (string) $reset_front_page_settings_for_post ); 

Parameters (1)

0. $reset_front_page_settings_for_post (string) => '_reset_front_page_settings_for_post'
The reset front page settings for post.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'wp_trash_post', $reset_front_page_settings_for_post ); 
The following example is for adding a hook callback.
  1. // define the wp_trash_post callback 
  2. function action_wp_trash_post( $reset_front_page_settings_for_post ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'wp_trash_post', 'action_wp_trash_post', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'wp_trash_post', 'action_wp_trash_post', 10, 1 ); 

Defined (3)

The action is defined in the following location(s).

/wp-includes/default-filters.php  
  1. add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' ); 
/wp-includes/post.php  
  1. do_action( 'wp_trash_post', $post_id ); 
/wp-includes/theme.php  
  1. do_action( 'wp_trash_post', $post_id );