before_delete_post

before_delete_post

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.5.4

do_action('before_delete_post') is found 1 times:

  • /wp-includes/post.php line 3512
    	 *
    	 * @param int     $postid Post ID.
    	 * @param WP_Post $post   Post object.
    	 */
    	do_action( 'before_delete_post', $postid, $post );
    
    	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 ) );
    
    

See this hook used in plugins: