WordPress.org

Make WordPress Core

Changeset 39305


Ignore:
Timestamp:
11/19/16 00:09:07 (5 months ago)
Author:
SergeyBiryukov
Message:

REST API: Merge two similar permission error strings in class-wp-rest-comments-controller.php.

We're checking if current_user_can( 'moderate_comments' ) here, not the specific comment permissions.

See #38857.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r39302 r39305  
    321321 
    322322        if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { 
    323             return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this comment with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); 
     323            return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view comments with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); 
    324324        } 
    325325 
Note: See TracChangeset for help on using the changeset viewer.