-
Notifications
You must be signed in to change notification settings - Fork 651
Posts controller abstraction #820
Conversation
`WP_JSON_Posts_Controller`
…gistration parameter
Each post type should have its own endpoint 19d90e9
|
@WP-API/amigos #reviewmerge |
|
@danielbachhuber if I had a very custom post type, what would be the best way to subclass
+1 for merging |
Yep. Probably should also make sure that the supplied class name is a subclass of
Open to suggestions, or we can file another issue and come back to it. |
Consistency with the rest of the `register_post_type()` API makes more sense
Posts controller abstraction
This pull request pulls the non-controversial changes out of #759 so we can continue moving forward.
Specifically, I have:
WP_JSON_Base_Posts_Controllerinto aWP_JSON_Posts_Controllerthat can be used with multiple post types.show_in_jsonargument. TheWP_JSON_Posts_Controlleris used by default for these post types, but they would be able to register their own controller class.post_type_supports()and other post type attributes (e.g. a post type has to supporttitlefor it to be present in the response). Extra data included inPOSTandPUTrequests is silently discarded.This pull request does not:
Once this is merged, I'll put together pull requests for each of the two aforementioned points.
See #718