Make WordPress Core

Ticket #39176: 39176.2.patch

File 39176.2.patch, 2.1 KB (added by ramiy, 8 years ago)
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

     
    321321                $term = get_term( (int) $request['id'], $this->taxonomy );
    322322
    323323                if ( ! $term || $term->taxonomy !== $this->taxonomy ) {
    324                         return new WP_Error( 'rest_term_invalid', __( "Term doesn't exist." ), array( 'status' => 404 ) );
     324                        return new WP_Error( 'rest_term_invalid', __( 'Term does not exist.' ), array( 'status' => 404 ) );
    325325                }
    326326
    327327                if ( is_wp_error( $term ) ) {
     
    374374                        $parent = get_term( (int) $request['parent'], $this->taxonomy );
    375375
    376376                        if ( ! $parent ) {
    377                                 return new WP_Error( 'rest_term_invalid', __( "Parent term doesn't exist." ), array( 'status' => 400 ) );
     377                                return new WP_Error( 'rest_term_invalid', __( 'Parent term does not exist.' ), array( 'status' => 400 ) );
    378378                        }
    379379                }
    380380
     
    453453                $term = get_term( (int) $request['id'], $this->taxonomy );
    454454
    455455                if ( ! $term ) {
    456                         return new WP_Error( 'rest_term_invalid', __( "Term doesn't exist." ), array( 'status' => 404 ) );
     456                        return new WP_Error( 'rest_term_invalid', __( 'Term does not exist.' ), array( 'status' => 404 ) );
    457457                }
    458458
    459459                if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
     
    481481                        $parent = get_term( (int) $request['parent'], $this->taxonomy );
    482482
    483483                        if ( ! $parent ) {
    484                                 return new WP_Error( 'rest_term_invalid', __( "Parent term doesn't exist." ), array( 'status' => 400 ) );
     484                                return new WP_Error( 'rest_term_invalid', __( 'Parent term does not exist.' ), array( 'status' => 400 ) );
    485485                        }
    486486                }
    487487
     
    542542                $term = get_term( (int) $request['id'], $this->taxonomy );
    543543
    544544                if ( ! $term ) {
    545                         return new WP_Error( 'rest_term_invalid', __( "Term doesn't exist." ), array( 'status' => 404 ) );
     545                        return new WP_Error( 'rest_term_invalid', __( 'Term does not exist.' ), array( 'status' => 404 ) );
    546546                }
    547547
    548548                if ( ! current_user_can( 'delete_term', $term->term_id ) ) {