Skip to content

Conversation

@kadamwhite
Copy link
Collaborator

Support default taxonomy collections using v2 endpoints.

Many of these changes are adapted from work by @jasonphillips in his fork of the project -- full props to him for pioneering how to adapt the existing infrastructure to the new endpoints.

Tasks before PR can land:

  • Update library to support querying /taxonomies endpoint for available taxonomies
  • Update library to support querying /taxonomies/:taxonomy endpoint for taxonomy definition object
  • Update library to support querying /categories 1st-party taxonomy term collection
  • Update library to support querying /categories/:id individual category terms
  • Verify library supports querying for individual category by slug
  • Update library to support querying /tags 1st-party taxonomy term collection
  • Update library to support querying /tags/:slug individual category terms
  • Verify library supports querying for individual tag by slug

Related work, to be executed separately:

Mocha specs and Chai assertions benefit from a longer permitted line length,
so that long "it" parameters and long chai assertion chains don't need to be
artificially forced to wrap.
Many of these changes are adapted from work by @jasonphillips in
his fork of the project -- full props to him for pioneering how
to adapt the existing infrastructure to the new endpoints.
Slug searches are cumbersome; filtering was originally added in
WP-API/WP-API#924 but has been removed again in the v2 betas
(see WP-API/WP-API#924 for latest status)

Integration tests demonstrate the best option we currently have,
which is to search for the term then iterate through the responses
from that search until you find a match.
@kadamwhite
Copy link
Collaborator Author

Querying by slug is "supported" inasmuch as 23ae892 adds a demonstration of how to do this by combining ?search and iterating over the responses. That's the best we can currently do due to limitations around what the API provides for taxonomies.

Again props to @jasonphillips for the initial implementation which I am
adapting here (see below for commit link)

jasonphillips@64ae6c4
@kadamwhite kadamwhite merged commit d83b3af into master Jan 21, 2016
@kadamwhite kadamwhite deleted the v2-taxonomy-support branch January 21, 2016 05:51
@kadamwhite kadamwhite mentioned this pull request Jan 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants