- Timestamp:
- 11/08/2016 01:08:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
r39126 r39161 118 118 public function get_items_permissions_check( $request ) { 119 119 120 $parent = $this->get_post( $request['parent'] );120 $parent = get_post( $request['parent'] ); 121 121 if ( ! $parent ) { 122 122 return true; … … 140 140 */ 141 141 public function get_items( $request ) { 142 143 $parent = $this->get_post( $request['parent'] ); 142 $parent = get_post( $request['parent'] ); 144 143 if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) { 145 144 return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) ); … … 179 178 */ 180 179 public function get_item( $request ) { 181 182 $parent = $this->get_post( $request['parent'] ); 180 $parent = get_post( $request['parent'] ); 183 181 if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) { 184 182 return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) ); 185 183 } 186 184 187 $revision = $this->get_post( $request['id'] );185 $revision = get_post( $request['id'] ); 188 186 if ( ! $revision || 'revision' !== $revision->post_type ) { 189 187 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision id.' ), array( 'status' => 404 ) ); … … 210 208 } 211 209 212 $post = $this->get_post( $request['id'] );210 $post = get_post( $request['id'] ); 213 211 if ( ! $post ) { 214 212 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision id.' ), array( 'status' => 404 ) ); … … 235 233 } 236 234 237 $revision = $this->get_post( $request['id'] );235 $revision = get_post( $request['id'] ); 238 236 $previous = $this->prepare_item_for_response( $revision, $request ); 239 237
Note: See TracChangeset
for help on using the changeset viewer.