Repository navigation
Add user endpoints #20
Description
Activity
how can I get this?
For now you can check out my repo - https://github.com/royboy789/WP-API it
has the code base for users in it.On Fri, Nov 15, 2013 at 11:29 AM, rmarji [email protected] wrote:
how can I get this?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-28596587
.Thank You,
Roy Sivan
www.roysivan.com
GuavaWorks
www.guavaworks.com
818.925.4214
415.889.9346Is there any update on when this will make it in to the master repository?
Can I help out in anyway?
Thanks!I could really do with this for a current project. @rmccue, what are your thoughts on @royboy789's work so far? @royboy789, I suggest you at least commit your work to a branch, and keep your master up-to-date with the upstream, rebasing as you go. That way Ryan can merge your code way more easily.
Actually, IIRC the API changed since Roy's work, so it needs re-doing.
I've made a start on the users endpoint at tobych@72f4942
It's based on @royboy789 's work, but redone against the current code. It's on a branch, which is rebased against master. No unit tests, no POSTing, and I'm ignoring $fields. It works for me. Next I'll try to get POST working. Then try to get out the extended/custom user attributes that plugins such as s2members add (which is what I need this for). This is pretty naive code, because I'm utterly naive about WP. I doubt we should be including the user's password, for one thing. I hope this isn't a waste of your time, having a look at this!
I've got editing (PUT/PATCH) working on some fields: https://github.com/tobych/WP-API/compare/users
Also I've realized there's already an entity defined for User in the documentation. It has very few fields though.I have DELETE working. I've realized that in WP, users have standard fields and "meta" fields, including some default fields. I guess they need to be handled cleverly. I want to get these out, next. Perhaps into a separate JSON dictionary within the main one.
I have PUT/PATCH and GET working nicely with metadata now. I'm representing data from serialized fields using a dictionary with a "unserialized" (and, for now, "serialized") key, so things work round-trip without the server needing to guess whether to serialize things. I've also moved the metadata to user_meta, away from the meta stuff already included in the User entity's definition (and implementation for Posts). One question is whether to bother representing every user_meta value as an array, or just do that when there really are multiple values. For now I'm always using an array, as anything else complicates things in the code.
I've just opened a pull request for this work without the meta handling.
- added a commit that references this issue
on Apr 30, 2014 - added a commit that references this issue
on Aug 1, 2014
Per #18, @royboy789 has a start on user endpoints.