Comments: Return early from wp_update_comment_count() if there is not a valid post.

Props ambrosey, juanfra. 
Fixes #34977



git-svn-id: https://develop.svn.wordpress.org/trunk@36115 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Rachel Baker 2015-12-28 22:57:37 +00:00
parent ee386bf22a
commit 61ff693ff0

View File

@ -2010,6 +2010,10 @@ function wp_defer_comment_counting($defer=null) {
function wp_update_comment_count($post_id, $do_deferred=false) {
static $_deferred = array();
if ( empty( $post_id ) && ! $do_deferred ) {
return false;
}
if ( $do_deferred ) {
$_deferred = array_unique($_deferred);
foreach ( $_deferred as $i => $_post_id ) {