Handler for updating the current site’s posts count when a post is deleted.
Parameters
$post_id
intrequired- Post ID.
$post
WP_Postrequired- Post object.
Source
function _update_posts_count_on_delete( $post_id, $post ) {
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
return;
}
update_posts_count();
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.