mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Check $post->post_status directly in _update_posts_count_on_delete() for better performance.
props pento. fixes #27952. Built from https://develop.svn.wordpress.org/trunk@29667 git-svn-id: http://core.svn.wordpress.org/trunk@29441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
683238567d
commit
8cc6ad5066
@ -917,7 +917,9 @@ function _update_blog_date_on_post_delete( $post_id ) {
|
||||
* @param int $post_id Post ID.
|
||||
*/
|
||||
function _update_posts_count_on_delete( $post_id ) {
|
||||
if ( 'publish' !== get_post_field( 'post_status', $post_id ) ) {
|
||||
$post = get_post( $post_id );
|
||||
|
||||
if ( ! $post || 'publish' !== $post->post_status ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user