Summery Summery
Handler for updating the current site’s posts count when a post status changes.
Syntax Syntax
Parameters Parameters
- $new_status
-
(Required) The status the post is changing to.
- $old_status
-
(Required) The status the post is changing from.
- $post
-
(Optional) Post object
Default value: null
Source Source
File: wp-includes/ms-blogs.php
$post = get_post( $post_id ); if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) { return; } update_posts_count(); } /** * Handler for updating the current site's posts count when a post status changes. * * @since 4.0.0 * @since 4.9.0 Added the `$post` parameter. *
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.9.0 | Added the $post parameter. |
4.0.0 | Introduced. |