_update_posts_count_on_delete

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

Description

_update_posts_count_on_delete( (int) $post_id ); 

Parameters (1)

0. $post_id (int)
The post id.

Usage

  1. if ( !function_exists( '_update_posts_count_on_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_posts_count_on_delete($post_id); 
  9.  

Defined (1)

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

/wp-includes/ms-blogs.php  
  1. function _update_posts_count_on_delete( $post_id ) { 
  2. $post = get_post( $post_id ); 
  3.  
  4. if ( ! $post || 'publish' !== $post->post_status ) { 
  5. return; 
  6.