Make WordPress Core


Ignore:
Timestamp:
11/20/2016 11:45:59 AM (8 years ago)
Author:
SergeyBiryukov
Message:

REST API: Update error messages in WP_REST_Comments_Controller to use the common text for permission errors.

Props ramiy.
Fixes #38875.

File:
1 edited

Legend:

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

    r39310 r39321  
    612612
    613613        if ( $comment && ! $this->check_edit_permission( $comment ) ) {
    614             return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you can not edit this comment.' ), array( 'status' => rest_authorization_required_code() ) );
     614            return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this comment.' ), array( 'status' => rest_authorization_required_code() ) );
    615615        }
    616616
     
    727727
    728728        if ( ! $this->check_edit_permission( $comment ) ) {
    729             return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you can not delete this comment.' ), array( 'status' => rest_authorization_required_code() ) );
     729            return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this comment.' ), array( 'status' => rest_authorization_required_code() ) );
    730730        }
    731731        return true;
Note: See TracChangeset for help on using the changeset viewer.