deleted_post

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

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