- 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-comments-controller.php
r39157 r39161 107 107 if ( ! empty( $request['post'] ) ) { 108 108 foreach ( (array) $request['post'] as $post_id ) { 109 $post = $this->get_post( $post_id );109 $post = get_post( $post_id ); 110 110 111 111 if ( ! empty( $post_id ) && $post && ! $this->check_read_post_permission( $post ) ) { … … 315 315 } 316 316 317 $post = $this->get_post( $comment->comment_post_ID );317 $post = get_post( $comment->comment_post_ID ); 318 318 319 319 if ( $post && ! $this->check_read_post_permission( $post ) ) { … … 346 346 347 347 if ( ! empty( $comment->comment_post_ID ) ) { 348 $post = $this->get_post( $comment->comment_post_ID );348 $post = get_post( $comment->comment_post_ID ); 349 349 if ( empty( $post ) ) { 350 350 return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post id.' ), array( 'status' => 404 ) ); … … 390 390 } 391 391 392 if ( ! empty( $request['post'] ) && $post = $this->get_post( (int) $request['post'] ) ) {392 if ( ! empty( $request['post'] ) && $post = get_post( (int) $request['post'] ) ) { 393 393 if ( 'draft' === $post->post_status ) { 394 394 return new WP_Error( 'rest_comment_draft_post', __( 'Sorry, you cannot create a comment on this post.' ), array( 'status' => 403 ) ); … … 872 872 873 873 if ( 0 !== (int) $comment->comment_post_ID ) { 874 $post = $this->get_post( $comment->comment_post_ID );874 $post = get_post( $comment->comment_post_ID ); 875 875 876 876 if ( ! empty( $post->ID ) ) {
Note: See TracChangeset
for help on using the changeset viewer.