From 72b100ed7e5157f1c8226694366ed1babe07109e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Nov 2016 20:39:13 +0000 Subject: [PATCH] REST API: Remove two duplicate strings, use the ones we already have. See #38791. git-svn-id: https://develop.svn.wordpress.org/trunk@39252 602fd350-edb4-49c9-b593-d223f7449a82 --- .../endpoints/class-wp-rest-comments-controller.php | 10 +++++----- .../endpoints/class-wp-rest-posts-controller.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 19a83f30f7..3286f1f564 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -341,13 +341,13 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { $comment = get_comment( $id ); if ( empty( $comment ) ) { - return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) ); } if ( ! empty( $comment->comment_post_ID ) ) { $post = get_post( $comment->comment_post_ID ); if ( empty( $post ) ) { - return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); } } @@ -611,7 +611,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { $comment = get_comment( $id ); if ( empty( $comment ) ) { - return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) ); } if ( isset( $request['type'] ) && get_comment_type( $id ) !== $request['type'] ) { @@ -701,7 +701,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { $comment = get_comment( $id ); if ( ! $comment ) { - return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) ); } if ( ! $this->check_edit_permission( $comment ) ) { @@ -726,7 +726,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { $comment = get_comment( $id ); if ( empty( $comment ) ) { - return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) ); } /** 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 434bff802c..183c1b03f9 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 @@ -423,7 +423,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $post = get_post( $id ); if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { - return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); } $data = $this->prepare_item_for_response( $post, $request ); @@ -619,7 +619,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $post = get_post( $id ); if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { - return new WP_Error( 'rest_post_invalid_id', __( 'Post id is invalid.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); } $post = $this->prepare_item_for_database( $request ); @@ -730,7 +730,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { $post = get_post( $id ); if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { - return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) ); + return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); } $supports_trash = ( EMPTY_TRASH_DAYS > 0 );