deleted_post

deleted_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('deleted_post') is found 2 times:

  • /wp-includes/post.php line 3812
    	 *
    	 * @param int     $post_id Post ID.
    	 * @param WP_Post $post    Post object.
    	 */
    	do_action( 'deleted_post', $post_id, $post );
    
    	clean_post_cache( $post );
    
    	if ( is_post_type_hierarchical( $post->post_type ) && $children ) {
    		foreach ( $children as $child ) {
    			clean_post_cache( $child );
    
  • /wp-includes/post.php line 6631
    	if ( ! $result ) {
    		return false;
    	}
    	/** This action is documented in wp-includes/post.php */
    	do_action( 'deleted_post', $post_id, $post );
    
    	wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file );
    
    	clean_post_cache( $post );
    
    	return $post;
    

See this hook used in plugins: