Changeset 39264
- Timestamp:
- 11/16/2016 12:17:31 PM (9 years ago)
- Location:
- trunk/src/wp-includes/rest-api/endpoints
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r39161 r39264 454 454 455 455 $schema['properties']['post'] = array( 456 'description' => __( 'The idfor the associated post of the resource.' ),456 'description' => __( 'The ID for the associated post of the resource.' ), 457 457 'type' => 'integer', 458 458 'context' => array( 'view', 'edit' ), -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r39259 r39264 1022 1022 $prepared_comment['comment_author_url'] = $user->user_url; 1023 1023 } else { 1024 return new WP_Error( 'rest_comment_author_invalid', __( 'Invalid comment author id.' ), array( 'status' => 400 ) );1024 return new WP_Error( 'rest_comment_author_invalid', __( 'Invalid comment author ID.' ), array( 'status' => 400 ) ); 1025 1025 } 1026 1026 } … … 1103 1103 ), 1104 1104 'author' => array( 1105 'description' => __( 'The idof the user object, if author was a user.' ),1105 'description' => __( 'The ID of the user object, if author was a user.' ), 1106 1106 'type' => 'integer', 1107 1107 'context' => array( 'view', 'edit', 'embed' ), … … 1188 1188 ), 1189 1189 'parent' => array( 1190 'description' => __( 'The idfor the parent of the object.' ),1190 'description' => __( 'The ID for the parent of the object.' ), 1191 1191 'type' => 'integer', 1192 1192 'context' => array( 'view', 'edit', 'embed' ), … … 1194 1194 ), 1195 1195 'post' => array( 1196 'description' => __( 'The idof the associated post object.' ),1196 'description' => __( 'The ID of the associated post object.' ), 1197 1197 'type' => 'integer', 1198 1198 'context' => array( 'view', 'edit' ), -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r39252 r39264 965 965 966 966 if ( ! $user_obj ) { 967 return new WP_Error( 'rest_invalid_author', __( 'Invalid author id.' ), array( 'status' => 400 ) );967 return new WP_Error( 'rest_invalid_author', __( 'Invalid author ID.' ), array( 'status' => 400 ) ); 968 968 } 969 969 } … … 996 996 997 997 if ( empty( $parent ) ) { 998 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post parent id.' ), array( 'status' => 400 ) );998 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post parent ID.' ), array( 'status' => 400 ) ); 999 999 } 1000 1000 … … 1087 1087 return true; 1088 1088 } else { 1089 return new WP_Error( 'rest_invalid_featured_media', __( 'Invalid featured media id.' ), array( 'status' => 400 ) );1089 return new WP_Error( 'rest_invalid_featured_media', __( 'Invalid featured media ID.' ), array( 'status' => 400 ) ); 1090 1090 } 1091 1091 } else { … … 1718 1718 if ( $post_type_obj->hierarchical ) { 1719 1719 $schema['properties']['parent'] = array( 1720 'description' => __( 'The idfor the parent of the object.' ),1720 'description' => __( 'The ID for the parent of the object.' ), 1721 1721 'type' => 'integer', 1722 1722 'context' => array( 'view', 'edit' ), … … 1832 1832 case 'author': 1833 1833 $schema['properties']['author'] = array( 1834 'description' => __( 'The idfor the author of the object.' ),1834 'description' => __( 'The ID for the author of the object.' ), 1835 1835 'type' => 'integer', 1836 1836 'context' => array( 'view', 'edit', 'embed' ), … … 1870 1870 case 'thumbnail': 1871 1871 $schema['properties']['featured_media'] = array( 1872 'description' => __( 'The idof the featured media for the object.' ),1872 'description' => __( 'The ID of the featured media for the object.' ), 1873 1873 'type' => 'integer', 1874 1874 'context' => array( 'view', 'edit' ), … … 2051 2051 if ( $post_type_obj->hierarchical || 'attachment' === $this->post_type ) { 2052 2052 $params['parent'] = array( 2053 'description' => __( 'Limit result set to those of particular parent ids.' ),2053 'description' => __( 'Limit result set to those of particular parent IDs.' ), 2054 2054 'type' => 'array', 2055 2055 'items' => array( … … 2059 2059 ); 2060 2060 $params['parent_exclude'] = array( 2061 'description' => __( 'Limit result set to all items except those of a particular parent id.' ),2061 'description' => __( 'Limit result set to all items except those of a particular parent ID.' ), 2062 2062 'type' => 'array', 2063 2063 'items' => array( -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
r39257 r39264 142 142 $parent = get_post( $request['parent'] ); 143 143 if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) { 144 return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) );144 return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent ID.' ), array( 'status' => 404 ) ); 145 145 } 146 146 … … 180 180 $parent = get_post( $request['parent'] ); 181 181 if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) { 182 return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) );182 return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent ID.' ), array( 'status' => 404 ) ); 183 183 } 184 184 185 185 $revision = get_post( $request['id'] ); 186 186 if ( ! $revision || 'revision' !== $revision->post_type ) { 187 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision id.' ), array( 'status' => 404 ) );187 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision ID.' ), array( 'status' => 404 ) ); 188 188 } 189 189 … … 210 210 $post = get_post( $request['id'] ); 211 211 if ( ! $post ) { 212 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision id.' ), array( 'status' => 404 ) );212 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision ID.' ), array( 'status' => 404 ) ); 213 213 } 214 214 $post_type = get_post_type_object( 'revision' ); … … 400 400 'properties' => array( 401 401 'author' => array( 402 'description' => __( 'The idfor the author of the object.' ),402 'description' => __( 'The ID for the author of the object.' ), 403 403 'type' => 'integer', 404 404 'context' => array( 'view', 'edit', 'embed' ), … … 439 439 ), 440 440 'parent' => array( 441 'description' => __( 'The idfor the parent of the object.' ),441 'description' => __( 'The ID for the parent of the object.' ), 442 442 'type' => 'integer', 443 443 'context' => array( 'view', 'edit', 'embed' ), -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
r39257 r39264 861 861 if ( $taxonomy->hierarchical ) { 862 862 $schema['properties']['parent'] = array( 863 'description' => __( 'The idfor the parent of the resource.' ),863 'description' => __( 'The ID for the parent of the resource.' ), 864 864 'type' => 'integer', 865 865 'context' => array( 'view', 'edit' ), -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r39257 r39264 313 313 314 314 if ( empty( $id ) || empty( $user->ID ) ) { 315 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource id.' ), array( 'status' => 404 ) );315 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource ID.' ), array( 'status' => 404 ) ); 316 316 } 317 317 … … 343 343 344 344 if ( empty( $id ) || empty( $user->ID ) ) { 345 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource id.' ), array( 'status' => 404 ) );345 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource ID.' ), array( 'status' => 404 ) ); 346 346 } 347 347 … … 540 540 541 541 if ( ! $user ) { 542 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource id.' ), array( 'status' => 404 ) );542 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource ID.' ), array( 'status' => 404 ) ); 543 543 } 544 544 … … 683 683 684 684 if ( ! $user ) { 685 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource id.' ), array( 'status' => 404 ) );685 return new WP_Error( 'rest_user_invalid_id', __( 'Invalid resource ID.' ), array( 'status' => 404 ) ); 686 686 } 687 687 688 688 if ( ! empty( $reassign ) ) { 689 689 if ( $reassign === $id || ! get_userdata( $reassign ) ) { 690 return new WP_Error( 'rest_user_invalid_reassign', __( 'Invalid resource idfor reassignment.' ), array( 'status' => 400 ) );690 return new WP_Error( 'rest_user_invalid_reassign', __( 'Invalid resource ID for reassignment.' ), array( 'status' => 400 ) ); 691 691 } 692 692 }
Note: See TracChangeset
for help on using the changeset viewer.