_update_blog_date_on_post_delete

Handler for updating the blog date when a published post is deleted.

Description

_update_blog_date_on_post_delete( (int) $post_id ); 

Parameters (1)

0. $post_id (int)
The post id.

Usage

  1. if ( !function_exists( '_update_blog_date_on_post_delete' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // The post id. 
  5. $post_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _update_blog_date_on_post_delete($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-blogs.php  
  1. function _update_blog_date_on_post_delete( $post_id ) { 
  2. $post = get_post( $post_id ); 
  3.  
  4. $post_type_obj = get_post_type_object( $post->post_type ); 
  5. if ( ! $post_type_obj || ! $post_type_obj->public ) { 
  6. return; 
  7.  
  8. if ( 'publish' != $post->post_status ) { 
  9. return; 
  10.