- Timestamp:
- 12/13/2016 01:52:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r39508 r39597 665 665 } 666 666 667 if ( ! empty( $prepared_args['comment_post_ID'] ) ) { 668 $post = get_post( $prepared_args['comment_post_ID'] ); 669 if ( empty( $post ) ) { 670 return new WP_Error( 'rest_comment_invalid_post_id', __( 'Invalid post ID.' ), array( 'status' => 403 ) ); 671 } 672 } 673 667 674 if ( empty( $prepared_args ) && isset( $request['status'] ) ) { 668 675 // Only the comment status is being changed. … … 691 698 $updated = wp_update_comment( wp_slash( (array) $prepared_args ) ); 692 699 693 if ( 0=== $updated ) {700 if ( false === $updated ) { 694 701 return new WP_Error( 'rest_comment_failed_edit', __( 'Updating comment failed.' ), array( 'status' => 500 ) ); 695 702 }
Note: See TracChangeset
for help on using the changeset viewer.