Comments: Return early from `wp_update_comment_count()` if there is not a valid post.
Props ambrosey, juanfra. Fixes #34977 Built from https://develop.svn.wordpress.org/trunk@36115 git-svn-id: http://core.svn.wordpress.org/trunk@36080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
23a6ee1af1
commit
a828b700fc
|
@ -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 ) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5-alpha-36114';
|
||||
$wp_version = '4.5-alpha-36115';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue