Make WordPress Core


Ignore:
Timestamp:
10/30/2025 11:54:22 AM (3 months ago)
Author:
wildworks
Message:

Editor: Add auth_callback to _wp_note_status comment meta.

Adds an auth_callback to the _wp_note_status comment meta so that only users with the edit_comment capability can update this meta field via the REST API.

This is necessary to ensure that users can properly resolve or reopen Notes.

Props wildworks, adamsilverstein, westonruter, mamaduka, desrosj.
Fixes #64153.

File:
1 edited

Legend:

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

    r61036 r61089  
    41304130                ),
    41314131            ),
     4132            'auth_callback' => function ( $allowed, $meta_key, $object_id ) {
     4133                return current_user_can( 'edit_comment', $object_id );
     4134            },
    41324135        )
    41334136    );
    41344137}
    4135 add_action( 'init', 'wp_create_initial_comment_meta' );
Note: See TracChangeset for help on using the changeset viewer.