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.7

do_action('before_delete_post') is found 1 times:

  • /wp-includes/post.php line 3703
    	 *
    	 * @param int     $post_id Post ID.
    	 * @param WP_Post $post    Post object.
    	 */
    	do_action( 'before_delete_post', $post_id, $post );
    
    	delete_post_meta( $post_id, '_wp_trash_meta_status' );
    	delete_post_meta( $post_id, '_wp_trash_meta_time' );
    
    	wp_delete_object_term_relationships( $post_id, get_object_taxonomies( $post->post_type ) );
    
    

See this hook used in plugins: