WordPress.org

Make WordPress Core

Ticket #34977: 34977.2.patch

File 34977.2.patch, 503 bytes (added by rachelbaker, 4 years ago)

Simplified logic from @juanfra's patch

  • src/wp-includes/comment.php

     
    20102010function wp_update_comment_count($post_id, $do_deferred=false) {
    20112011        static $_deferred = array();
    20122012
     2013        if ( empty( $post_id ) && ! $do_deferred ) {
     2014                return false;
     2015        }
     2016
    20132017        if ( $do_deferred ) {
    20142018                $_deferred = array_unique($_deferred);
    20152019                foreach ( $_deferred as $i => $_post_id ) {