wp_trash_post action-hookWP 3.3.0

Fires before a post is sent to the Trash.

Usage

add_action( 'wp_trash_post', 'wp_kama_trash_post_action' );

/**
 * Function for `wp_trash_post` action-hook.
 * 
 * @param int $post_id Post ID.
 *
 * @return void
 */
function wp_kama_trash_post_action( $post_id ){

	// action...
}
$post_id(int)
Post ID.

Changelog

Since 3.3.0 Introduced.

Where the hook is called

wp_trash_post()
wp_trash_post
WP_Customize_Manager::trash_changeset_post()
wp_trash_post
wp-includes/post.php 3567
do_action( 'wp_trash_post', $post_id );
wp-includes/class-wp-customize-manager.php 3084
do_action( 'wp_trash_post', $post_id );

Where the hook is used in WordPress

wp-includes/default-filters.php 539
add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' );