[wp-trac] [WordPress Trac] #39976: Taxonomies and Types should return rewrite info

WordPress Trac noreply at wordpress.org
Mon Feb 27 16:44:04 UTC 2017


#39976: Taxonomies and Types should return rewrite info
----------------------------+-----------------------------
 Reporter:  wonderboymusic  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  REST API        |    Version:  4.7
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 Taxonomies and Types behave similarly in the REST API endpoints that bear
 their fruit.

 `slug` is actually the `id` of the object
 `name` is the "label" for publicly identifying the taxonomy as text

 There is, however, no representation of what the "pretty" version, or
 "slug", is for the taxonomy.

 As an example:
 `post_tag` is the ID
 "Tags"/"Tag" is the label (it would be nice to also have labels returned
 tho....)
 ... missing info: what is the slug representation of `post_tag` - the
 answer is `tag`, but this info is missing from the REST API response.

 **Why is this important?**

 If `food.whatever.com` is reading REST API data from `services.taco.com`,
 and providing URLs on its site for arbitrary terms, it makes sense to
 create the routes to this terms as `/{taxonomy.pretty}/{term.slug}` -
 right now, the slug is `post_tag`, not `tag`. `/post_tag/burrito` is not
 as nice as `/tag/burrito`

 Devs are also encouraged to namespace their registration, so taxonomies on
 the NYT would have a a registration value of `nyt_kicker`, which might be
 displayed as `column` - which is nowhere to be found in the response.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39976>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list