Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API: Post types and taxonomies labels #2499

Closed
aduth opened this issue Aug 22, 2017 · 2 comments
Closed

REST API: Post types and taxonomies labels #2499

aduth opened this issue Aug 22, 2017 · 2 comments
Labels
Core REST API Task Task for Core REST API efforts

Comments

@aduth
Copy link
Member

aduth commented Aug 22, 2017

Related: #2489 (comment)

Relevant APIs:

Prior art:

There's a need to show post type and taxonomy labels in the Gutenberg interface. This will enhance the experience of related workflows such as "Add New Genre" (for a genre custom taxonomy) in place of the generic "Add New Tag".

Potentially, this ties into a larger need for sharing localized strings between the server and client, but in these cases the strings are very dynamic (depending on which post types / taxonomies registered).

Potential solutions may include bootstrapping localized strings from the server using wp_localize_script, but it opens concerns of:

  • How scalable is this approach for increasingly client-based interfaces? Media library strings are the closest example and are already quite unwieldy.
  • What solution is there for interfaces consuming from the REST API which don't have the option to bootstrap from the server (e.g. static single-page applications)?
@aduth aduth added the Core REST API Task Task for Core REST API efforts label Aug 22, 2017
@TimothyBJacobs
Copy link
Member

Both the wp/v2/types and wp/v2/taxonomies endpoints should contain the labels.

@aduth
Copy link
Member Author

aduth commented Aug 23, 2017

On pointers from @rmccue and confirming in testing, I did find both the types and taxonomies endpoints include labels when specifying ?context=edit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts
Projects
None yet
Development

No branches or pull requests

2 participants