Make WordPress Core


Ignore:
Timestamp:
12/01/2025 03:42:24 PM (3 months ago)
Author:
ellatrix
Message:

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

Follow-up to [60987].

Reviewed by ellatrix.
Merges [61336] to the 6.9 branch.

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

Location:
branches/6.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.9

  • branches/6.9/src/wp-includes/comment.php

    r61274 r61337  
    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.