- Timestamp:
- 11/16/2016 12:17:31 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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' ),
Note: See TracChangeset
for help on using the changeset viewer.