wphooks.info - before_delete_post

before_delete_post

(trunk - 5.0-alpha-43304)

The hook occurs in the following file:

wp-includes/post.php:
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
	/**
	 * Fires before a post is deleted, at the start of wp_delete_post().
	 *
	 * @since 3.2.0
	 *
	 * @see wp_delete_post()
	 *
	 * @param int $postid Post ID.
	 */
	do_action( 'before_delete_post', $postid );

	delete_post_meta( $postid, '_wp_trash_meta_status' );
	delete_post_meta( $postid, '_wp_trash_meta_time' );

	wp_delete_object_term_relationships( $postid, get_object_taxonomies( $post->post_type ) );

	$parent_data  = array( 'post_parent' => $post->post_parent );
	$parent_where = array( 'post_parent' => $postid );