-
Notifications
You must be signed in to change notification settings - Fork 651
[WIP] Convert meta endpoints to new-style #960
Conversation
|
Alright, the controllers are migrated, but still needs unit tests converted across. (I suspect I'll find further bugs as those are migrated.) |
plugin.php
Outdated
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.
There should probably be a way to override this; I'm thinking $post_type->json_meta_controller_class, which defaults to the above?
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 think we can just register by default for posts, users and comments, and figure out the abstraction in a later beta.
|
I was hoping to include a _link in the Posts response to the meta endpoint, but cannot seem to find the appropriate relationship: http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 |
Done.
Not sure what the difference between these is? I've added the link from the post out to the meta items, was the other just the reverse of that? |
Not sure why we had it on update either, that was wrong...
|
This is no longer One note: @danielbachhuber said above:
Unlike the posts controller, we have two fundamentally different objects (posts and users, with potentially comments and terms) that have different permissions checks and such. For example, comment meta would need to check the comment and potentially also the parent post. @WP-API/amigos #reviewmerge |
Couldn't we have some conditional logic based on Pages are fundamentally different than Posts, and we've accommodated them both just fine in the Posts controller. @joehoyle thoughts? |
No longer need this!
We have a small amount right now, yeah ( Pages and posts are both fundamentally CPTs, so they follow a bunch of similar patterns. Both store meta in the database equally, both have the same system to check permissions, etc. Posts and users however are a fair bit different. We could do it, but we'll end up with some kinda nasty conditionals in the permission checks. As is, the permission checks are essentially the only place we need to subclass right now, so I think it's fine as-is. We can always revisit and refactor if we need to when we add user meta. |
Convert meta endpoints to new-style
Fixes #928.