Make WordPress Core

Changeset 39304


Ignore:
Timestamp:
11/18/2016 11:52:21 PM (8 years ago)
Author:
SergeyBiryukov
Message:

REST API: Merge two similar permission error strings.

Props ramiy.
Fixes #38857.

Location:
trunk/src/wp-includes/rest-api/endpoints
Files:
3 edited

Legend:

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

    r39257 r39304  
    128128
    129129        if ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) {
    130             return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage this resource.' ), array( 'status' => rest_authorization_required_code() ) );
     130            return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );
    131131        }
    132132
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php

    r39257 r39304  
    142142            }
    143143            if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->manage_terms ) ) {
    144                 return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage this resource.' ), array( 'status' => rest_authorization_required_code() ) );
     144                return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );
    145145            }
    146146        }
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r39278 r39304  
    516516
    517517        if ( ! current_user_can( 'edit_user', $id ) ) {
    518             return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit resource.' ), array( 'status' => rest_authorization_required_code() ) );
     518            return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) );
    519519        }
    520520
Note: See TracChangeset for help on using the changeset viewer.