-
Notifications
You must be signed in to change notification settings - Fork 651
Add User endpoint (no user_meta handling) #128
Add User endpoint (no user_meta handling) #128
Conversation
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.
We should handle this too.
|
Phew; tonnes of inline comments above, but fantastic start on this! Thanks so much for what you have so far! Feel free to ask any questions about anything I've mentioned; you can also email me directly if you'd prefer. :) |
|
Thanks for the comments. I'll move things forward, with individual commits. Then when you're ready to pull I can squash them all together into one. Meanwhile, I'm wondering if there should be a class for each User called |
|
You can now add a user. More to come, but my six-year-old just woke up. |
Also updates some error messages
|
I've now done everything @rmccue has suggested, I think, apart from pagination, as explained above. |
|
@rmccue has pointed out that "current_user_can('edit_user', $id) is called a meta cap. It maps to the correct real permission internally (edit_users/edit_profile or appropriate other permission).". So I'll update that. |
Also, make error messages less apologetic. Sorry about that.
|
I've updated all the permission checks to improve things. |
|
Okay, that's all for now. Feedback please! |
Fantastic work, I'll take a look and get back to you. :) |
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.
We should stick strictly to one-class-per-file. It's fine to just use the values inline, since HTTP status codes have a one-to-one mapping from code to type. (As much as I hate magic values.)
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.
I don't want to have to keep looking up what each code is called, let alone the semantics, and I doubt anyone else does. Are there REALLY not constants defined elsewhere in PHP, or in WordPress? The more I look at WordPress and PHP, the more my eyes bleed. PHP still doesn't have enumerations? Unless you install a binary doodah? Anyway. Ahem. One must plow on. I can move the class out to a separate file.
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.
Happy to add them somewhere if you think it'll help readability, but that should be a separate PR. :)
|
Your code here looks pretty solid; I'm happy to try it out and take over the pull request if you'd like? :) |
|
Sure, that'd be great. I feel like I've reached diminishing returns here. I have ideas about meta handling: I need that for my paid project. How can I best be involved in that discussion, if at all, do you think? |
|
Closed in favour of #146.
I think I answered this elsewhere, but if not, jump into the meta ticket and let me know your thoughts. :) |
No description provided.