Uses
| Uses | Description |
|---|---|
| wp-includes/post.php: get_post() | Retrieves post data given a post ID or post object. |
| wp-includes/ms-functions.php: update_posts_count() | Update a blog’s post count. |
Handler for updating the current site’s posts count when a post is deleted.
(int) (Required) Post ID.
File: wp-includes/ms-blogs.php
function _update_posts_count_on_delete( $post_id ) {
$post = get_post( $post_id );
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
return;
}
update_posts_count();
} | Version | Description |
|---|---|
| 4.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_update_posts_count_on_delete