WordPress.org

Make WordPress Core

Ticket #38857: 38857.patch

File 38857.patch, 2.2 KB (added by ramiy, 5 years ago)
  • class-wp-rest-post-types-controller.php

     
    127127                }
    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
    133133                $data = $this->prepare_item_for_response( $obj, $request );
  • class-wp-rest-taxonomies-controller.php

     
    141141                                return false;
    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                }
    147147
  • class-wp-rest-users-controller.php

     
    515515                $id = (int) $request['id'];
    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
    521521                if ( ! empty( $request['roles'] ) && ! current_user_can( 'edit_users' ) ) {