REST API: Remove two duplicate strings, use the ones we already have.
See #38791. Built from https://develop.svn.wordpress.org/trunk@39252 git-svn-id: http://core.svn.wordpress.org/trunk@39192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cc14606094
commit
9c2ea0b8c7
|
@ -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 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-beta3-39251';
|
||||
$wp_version = '4.7-beta3-39252';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue