Audit filters and actions #1167
Comments
It would be nice if the "get_items" controller function had a filter before returning back the response, passing in the $query and the array of items. This way you can add more data based on the query as a whole rather then just individual items (with "rest_prepare_" filter). For example when retrieving all the posts for a particular category, it would be good to get the archive title/description back with the data as well, plus other tags that are available outside of the loop. It would also be good if the data structure was slightly different for returning multiple items as well like:
I'm loving this plugin, hope it becomes part of wordpress core soon :) |
We should make sure we consistently pass |
Punted to Beta 4 |
Should we also list the filters and what not on the v2.wp-api.org site? |
Yes, we could if someone wanted to set that up. |
Ya I will. What do we need to audit about the filters just to make sure we have a consistent structure and naming to them in the controllers? |
More or less. |
extras.php
lib/endpoints/class-wp-rest-attachments-controller.php
lib/endpoints/class-wp-rest-comments-controller.php
lib/endpoints/class-wp-rest-post-statuses-controller.php
lib/endpoints/class-wp-rest-post-types-controller.php
lib/endpoints/class-wp-rest-posts-controller.php
lib/endpoints/class-wp-rest-revisions-controller.php
lib/endpoints/class-wp-rest-taxonomies-controller.php
lib/endpoints/class-wp-rest-terms-controller.php
lib/endpoints/class-wp-rest-users-controller.php
|
I'll get this into a more user friendly format for the docs. This is just here for reviewing the hooks currently in WP API. If there is a more useful format let me know your thoughts and I'll change my script up. |
In #2396 an interesting discussion was brought up about the use of |
Maybe Basic structure looks pretty consistent. |
Also if both |
Let's make sure our controllers have a consistent pattern of filters and actions.
The text was updated successfully, but these errors were encountered: