Make WordPress Core

Changeset 39252


Ignore:
Timestamp:
11/15/2016 08:39:13 PM (8 years ago)
Author:
SergeyBiryukov
Message:

REST API: Remove two duplicate strings, use the ones we already have.

See #38791.

Location:
trunk/src/wp-includes/rest-api/endpoints
Files:
2 edited

Legend:

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

    r39250 r39252  
    342342        $comment = get_comment( $id );
    343343        if ( empty( $comment ) ) {
    344             return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) );
     344            return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) );
    345345        }
    346346
     
    348348            $post = get_post( $comment->comment_post_ID );
    349349            if ( empty( $post ) ) {
    350                 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) );
     350                return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) );
    351351            }
    352352        }
     
    612612
    613613        if ( empty( $comment ) ) {
    614             return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) );
     614            return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) );
    615615        }
    616616
     
    702702
    703703        if ( ! $comment ) {
    704             return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) );
     704            return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) );
    705705        }
    706706
     
    727727
    728728        if ( empty( $comment ) ) {
    729             return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment id.' ), array( 'status' => 404 ) );
     729            return new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) );
    730730        }
    731731
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r39251 r39252  
    424424
    425425        if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) {
    426             return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) );
     426            return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) );
    427427        }
    428428
     
    620620
    621621        if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) {
    622             return new WP_Error( 'rest_post_invalid_id', __( 'Post id is invalid.' ), array( 'status' => 404 ) );
     622            return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) );
    623623        }
    624624
     
    731731
    732732        if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) {
    733             return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) );
     733            return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) );
    734734        }
    735735
Note: See TracChangeset for help on using the changeset viewer.