Skip to content

Loading…

Rename variable in get_revisions method to $parent. #284

Merged
merged 1 commit into from

2 participants

@rachelbaker
WordPress REST API Team member

Corrects regression in ebabff8

@rachelbaker
WordPress REST API Team member

@rmccue #reviewmerge

@rmccue
WordPress REST API Team member

Nice catch!

@rmccue rmccue added this to the 1.1 milestone
@rachelbaker rachelbaker merged commit 7b45427 into master

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
@rachelbaker rachelbaker deleted the fix-revision-var branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 2, 2014
  1. @rachelbaker

    Rename variable in get_revisions method to $parent.

    rachelbaker committed
    Corrects regression in ebabff.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/class-wp-json-posts.php
View
6 lib/class-wp-json-posts.php
@@ -84,13 +84,13 @@ public function register_routes( $routes ) {
public function get_revisions( $id ) {
$id = (int) $id;
- $post = get_post( $id, ARRAY_A );
+ $parent = get_post( $id, ARRAY_A );
- if ( empty( $id ) || empty( $post['ID'] ) ) {
+ if ( empty( $id ) || empty( $parent['ID'] ) ) {
return new WP_Error( 'json_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) );
}
- if ( ! $this->check_edit_permission( $post ) ) {
+ if ( ! $this->check_edit_permission( $parent ) ) {
return new WP_Error( 'json_cannot_view', __( 'Sorry, you cannot view the revisions for this post.' ), array( 'status' => 403 ) );
}
Something went wrong with that request. Please try again.