wphooks.info - trashed_post

trashed_post

The hook occurs in the following 2 files

wp-includes/post.php:
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
	wp_trash_post_comments($post_id);

	/**
	 * Fires after a post is sent to the trash.
	 *
	 * @since 2.9.0
	 *
	 * @param int $post_id Post ID.
	 */
	do_action( 'trashed_post', $post_id );

	return $post;
}

/**
 * Restore a post or page from the Trash.
 *
 * @since 2.9.0
 *
wp-includes/theme.php:
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
			/** This action is documented in wp-includes/post.php */
			do_action( "save_post_{$post->post_type}", $post->ID, $post, true );

			/** This action is documented in wp-includes/post.php */
			do_action( 'save_post', $post->ID, $post, true );

			/** This action is documented in wp-includes/post.php */
			do_action( 'wp_insert_post', $post->ID, $post, true );

			/** This action is documented in wp-includes/post.php */
			do_action( 'trashed_post', $post_id );
		}
	}
}

/**
 * Filters changeset post data upon insert to ensure post_name is intact.
 *
 * This is needed to prevent the post_name from being dropped when the post is
 * transitioned into pending status by a contributor.