- Timestamp:
- 11/08/2016 01:08:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r39155 r39161 351 351 public function get_item_permissions_check( $request ) { 352 352 353 $post = $this->get_post( (int) $request['id'] );353 $post = get_post( (int) $request['id'] ); 354 354 355 355 if ( 'edit' === $request['context'] && $post && ! $this->check_update_permission( $post ) ) { … … 420 420 public function get_item( $request ) { 421 421 $id = (int) $request['id']; 422 $post = $this->get_post( $id );422 $post = get_post( $id ); 423 423 424 424 if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { … … 532 532 } 533 533 534 $post = $this->get_post( $post_id );534 $post = get_post( $post_id ); 535 535 536 536 if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { … … 583 583 public function update_item_permissions_check( $request ) { 584 584 585 $post = $this->get_post( $request['id'] );585 $post = get_post( $request['id'] ); 586 586 $post_type = get_post_type_object( $this->post_type ); 587 587 … … 616 616 public function update_item( $request ) { 617 617 $id = (int) $request['id']; 618 $post = $this->get_post( $id );618 $post = get_post( $id ); 619 619 620 620 if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { … … 668 668 } 669 669 670 $post = $this->get_post( $post_id );670 $post = get_post( $post_id ); 671 671 672 672 if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { … … 705 705 public function delete_item_permissions_check( $request ) { 706 706 707 $post = $this->get_post( $request['id'] );707 $post = get_post( $request['id'] ); 708 708 709 709 if ( $post && ! $this->check_delete_permission( $post ) ) { … … 727 727 $force = (bool) $request['force']; 728 728 729 $post = $this->get_post( $id );729 $post = get_post( $id ); 730 730 731 731 if ( empty( $id ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { … … 780 780 // the trash is disabled.) 781 781 $result = wp_trash_post( $id ); 782 $post = $this->get_post( $id );782 $post = get_post( $id ); 783 783 $response = $this->prepare_item_for_response( $post, $request ); 784 784 } … … 1072 1072 // Parent. 1073 1073 if ( ! empty( $schema['properties']['parent'] ) && ! empty( $request['parent'] ) ) { 1074 $parent = $this->get_post( (int) $request['parent'] );1074 $parent = get_post( (int) $request['parent'] ); 1075 1075 1076 1076 if ( empty( $parent ) ) { … … 1184 1184 */ 1185 1185 public function handle_template( $template, $post_id ) { 1186 if ( in_array( $template, array_keys( wp_get_theme()->get_page_templates( $this->get_post( $post_id ) ) ), true ) ) {1186 if ( in_array( $template, array_keys( wp_get_theme()->get_page_templates( get_post( $post_id ) ) ), true ) ) { 1187 1187 update_post_meta( $post_id, '_wp_page_template', $template ); 1188 1188 } else { … … 1301 1301 // Can we read the parent if we're inheriting? 1302 1302 if ( 'inherit' === $post->post_status && $post->post_parent > 0 ) { 1303 $parent = $this->get_post( $post->post_parent );1303 $parent = get_post( $post->post_parent ); 1304 1304 return $this->check_read_permission( $parent ); 1305 1305 }
Note: See TracChangeset
for help on using the changeset viewer.