This repository has been archived by the owner on Sep 24, 2018. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also updates some error messages
Also, make error messages less apologetic. Sorry about that.
This brings permissions error messages in line with the post endpoints.
get_userdata will check if the user ID is valid, let's not second guess this ourselves.
I like the concept, but it doesn't belong in this PR.
return new WP_Error( 'json_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 500 ) ); | ||
} | ||
else { | ||
// "TODO: return a HTTP 202 here instead"... says the Post endpoint... really? Inappropriate (says tobych)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobych Just FYI: the reason the comment is here in the post endpoint is because it's a different check there. In Post::delete_post
, this branch is for trashed posts; a 202 would indicate that the request to delete has been received, but the post is still available, just in a trashed state.
*/ | ||
protected function update_user( $user, $data ) { | ||
|
||
// Won't let them update these fields: ID, login, pass, registered (silently ignored) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be removed.
This returns the data for the current user, and also issues a 302 redirect to the current user's endpoint permalink (e.g. /users/42)
@rachelbaker #reviewmerge :) |
@rmccue This all works great! Merging into trunk. |
rachelbaker
added a commit
that referenced
this pull request
Apr 30, 2014
Add endpoints to handle user management. Closes #20.
kellbot
pushed a commit
to kellbot/WP-API
that referenced
this pull request
Aug 1, 2014
Add endpoints to handle user management. Closes WP-API#20.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
This is a continuation of #128 with some cleanups, and adding extra functionality.
Insanely huge props to @tobych on this one; he's done almost all of the heavy lifting here.
Things left to do:
/users/me
update_user
Posts::prepare_author()
Will fix #20.