wp_trash_post

wp_trash_post

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

See hook in core

Displaying hooks found in version: wordpress-6.1.1

do_action('wp_trash_post') is found 2 times:

  • /wp-includes/class-wp-customize-manager.php line 3085
    			return $check;
    		}
    
    		/** This action is documented in wp-includes/post.php */
    		do_action( 'wp_trash_post', $post_id );
    
    		add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status );
    		add_post_meta( $post_id, '_wp_trash_meta_time', time() );
    
    		$old_status = $post->post_status;
    		$new_status = 'trash';
    
  • /wp-includes/post.php line 3583
    	 * @since 3.3.0
    	 *
    	 * @param int $post_id Post ID.
    	 */
    	do_action( 'wp_trash_post', $post_id );
    
    	add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status );
    	add_post_meta( $post_id, '_wp_trash_meta_time', time() );
    
    	$post_updated = wp_update_post(
    		array(
    

See this hook used in plugins: