delete_post

delete_post

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

See hook in core

Displaying hooks found in version: wordpress-6.4.3

do_action('delete_post') is found 2 times:

  • /wp-includes/post.php line 3496
    	 *
    	 * @param int     $postid Post ID.
    	 * @param WP_Post $post   Post object.
    	 */
    	do_action( 'delete_post', $postid, $post );
    
    	$result = $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) );
    	if ( ! $result ) {
    		return false;
    	}
    
    
  • /wp-includes/post.php line 6325
    		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: