Make WordPress Core


Ignore:
Timestamp:
12/01/2025 03:31:41 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Notes: Avoid incrementing comment_count when notes are resolved or reopened.

Follow-up to [60987].

Props hbhalodia, wildworks, shimotomoki, gulamdastgir04, JeffPaul, ellatrix, SergeyBiryukov.
Fixes #64325.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r61270 r61336  
    28732873
    28742874    if ( is_null( $new ) ) {
    2875         $new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id ) );
     2875        $new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND comment_type != 'note'", $post_id ) );
    28762876    } else {
    28772877        $new = (int) $new;
Note: See TracChangeset for help on using the changeset viewer.