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

WordPress Trac noreply at wordpress.org
Tue Feb 28 00:03:56 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          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by rmccue):

 Generally speaking, I'd like to avoid providing raw values (like the
 rewrite slug), and replace them with better ways to achieve the actual
 goal. Typically, this is via linking; we don't expose `rest_base`, but
 rather expose that via a link.

 For rewrites, rather than just expose the value, the main thing they're
 used for is building URLs. Generally speaking, building URLs is a Bad Idea
 (since each URL is individually filterable), but there is utility in it.

 There's two things we want here: a link to the taxonomy page, and a way to
 build term links. What if we add a new link with something like `"item": {
 "href": "http://example.com/this_tax/{slug}" }` (using URL Templates)?
 Would that cover this use case?

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


More information about the wp-trac mailing list