trashed_post action-hookWP 2.9.0

Fires after a post is sent to the Trash.

Usage

add_action( 'trashed_post', 'wp_kama_trashed_post_action' );

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

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

Changelog

Since 2.9.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.