From ec023e37ecbfb6ada233d901bdb789d397d5553a Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Sun, 20 Nov 2016 22:35:44 +0000 Subject: [PATCH] REST API: Merge two error messages for edit / update. Props ramiy. Fixes #38879. git-svn-id: https://develop.svn.wordpress.org/trunk@39322 602fd350-edb4-49c9-b593-d223f7449a82 --- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 3265691f7f..ba241c94fa 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -587,7 +587,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $post_type = get_post_type_object( $this->post_type ); if ( $post && ! $this->check_update_permission( $post ) ) { - return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to update this post.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this post.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! empty( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( $post_type->cap->edit_others_posts ) ) {