delete_post

delete_post

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

See hook in core

Displaying hooks found in version: wordpress-6.7.1

do_action('delete_post') is found 2 times:

  • /wp-includes/post.php line 3783
    	 *
    	 * @param int     $post_id Post ID.
    	 * @param WP_Post $post    Post object.
    	 */
    	do_action( 'delete_post', $post_id, $post );
    
    	$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
    	if ( ! $result ) {
    		return false;
    	}
    
    
  • /wp-includes/post.php line 6625
    		delete_metadata_by_mid( 'post', $mid );
    	}
    
    	/** This action is documented in wp-includes/post.php */
    	do_action( 'delete_post', $post_id, $post );
    	$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) );
    	if ( ! $result ) {
    		return false;
    	}
    	/** This action is documented in wp-includes/post.php */
    	do_action( 'deleted_post', $post_id, $post );
    

See this hook used in plugins: