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:
parent
ee386bf22a
commit
61ff693ff0
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user