Make WordPress Core


Ignore:
Timestamp:
10/31/2025 06:55:47 PM (6 months ago)
Author:
adamsilverstein
Message:

Editor: Notes should not appear in the context of comments.

Prevent notes from inadvertently showing up in the context of comments - including on the Dashboard recent comments widget and the “Mine” count on the Comments page. Notes are stored as a custom ‘note’ comment type and this change ensures the note type is only returned when explicitly requested, or when ‘all’ types are requested.

The query for note children is modified to return all child notes. This fixes an issue where children were no longer being returned for the ‘note’ type.

Also fixes https://github.com/WordPress/gutenberg/issues/72548.

Props adamsilverstein, timothyblynjacobs, shailu25, peterwilsoncc, westonruter, mamaduka, kadamwhite.
Fixes #64145.
Fixes #64152.

File:
1 edited

Legend:

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

    r60697 r61105  
    537537     *
    538538     * @since 4.4.0
     539     * @since 6.9.0 Excludes the 'note' comment type, unless 'all' or the 'note' types are requested.
    539540     *
    540541     * @global wpdb $wpdb WordPress database abstraction object.
     
    770771            'NOT IN' => (array) $this->query_vars['type__not_in'],
    771772        );
     773
     774        // Exclude the 'note' comment type, unless 'all' types or the 'note' type explicitly are requested.
     775        if (
     776            ! in_array( 'all', $raw_types['IN'], true ) &&
     777            ! in_array( 'note', $raw_types['IN'], true ) &&
     778            ! in_array( 'note', $raw_types['NOT IN'], true )
     779        ) {
     780            $raw_types['NOT IN'][] = 'note';
     781        }
    772782
    773783        $comment_types = array();
Note: See TracChangeset for help on using the changeset viewer.