Make WordPress Core


Ignore:
Timestamp:
11/15/2016 11:35:50 PM (7 years ago)
Author:
SergeyBiryukov
Message:

REST API: Unify some more permission error messages.

Props ramiy.
Fixes #38803.

File:
1 edited

Legend:

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

    r39257 r39259  
    110110
    111111                if ( ! empty( $post_id ) && $post && ! $this->check_read_post_permission( $post ) ) {
    112                     return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you cannot read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) );
     112                    return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) );
    113113                } elseif ( 0 === $post_id && ! current_user_can( 'moderate_comments' ) ) {
    114114                    return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to read comments without a post.' ), array( 'status' => rest_authorization_required_code() ) );
     
    400400
    401401            if ( ! $this->check_read_post_permission( $post ) ) {
    402                 return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you cannot read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) );
     402                return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) );
    403403            }
    404404
     
    616616
    617617        if ( isset( $request['type'] ) && get_comment_type( $id ) !== $request['type'] ) {
    618             return new WP_Error( 'rest_comment_invalid_type', __( 'Sorry, you cannot change the comment type.' ), array( 'status' => 404 ) );
     618            return new WP_Error( 'rest_comment_invalid_type', __( 'Sorry, you are not allowed to change the comment type.' ), array( 'status' => 404 ) );
    619619        }
    620620
Note: See TracChangeset for help on using the changeset viewer.