Skip to content
This repository has been archived by the owner. It is now read-only.

Abstract revisions to dedicated controller; only include revisioned fields #1110

Merged
merged 3 commits into from Apr 17, 2015

Conversation

Projects
None yet
2 participants
@danielbachhuber
Copy link
Member

commented Apr 17, 2015

Fixes #869, #855
See #894, #314

@danielbachhuber

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2015

@WP-API/amigos #reviewmerge

$post = get_post( $request['id'] );
if ( ! $post || 'revision' !== $post->post_type ) {
return new WP_Error( 'json_post_invalid_id', __( 'Invalid revision ID.' ), array( 'status' => 404 ) );

This comment has been minimized.

Copy link
@joehoyle

joehoyle Apr 17, 2015

Contributor

Elsewhere we have not thrown invalid errors in the permissions checks. We'd typically not return any error in the case of the post not existing, or being the wrong post type - and handle that check in the get_item callback it's self.

This comment has been minimized.

Copy link
@danielbachhuber
@joehoyle

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2015

Just a concern around the error checking done in the permissions callbacks, as I'm not sure if that is the best place for those checks. Apart from that - I'm happy.

joehoyle added a commit that referenced this pull request Apr 17, 2015

Merge pull request #1110 from WP-API/869-revisions
Abstract revisions to dedicated controller; only include revisioned fields

@joehoyle joehoyle merged commit 327ab87 into develop Apr 17, 2015

2 checks passed

Scrutinizer 9 new issues, 30 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@joehoyle joehoyle deleted the 869-revisions branch Apr 17, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.