[wp-gsoc] [WordPress GSoC Trac] #386: No route found when using taxonomies with hyphens

WordPress GSoC Trac noreply at wordpress.org
Mon Sep 30 07:06:25 UTC 2019


#386: No route found when using taxonomies with hyphens
---------------------------+--------------------
 Reporter:  mijnhost       |      Owner:  rmccue
     Type:  defect         |     Status:  new
 Priority:  normal         |  Milestone:
Component:  JSON REST API  |   Keywords:
---------------------------+--------------------
 See ticket #384. Is this solved?

 When using taxonomies with hyphens like "my-taxonomy", you get routing
 errors for URLs like
 ` /wp-json/taxonomies/my-taxonomy/`

 I think the problem comes when registering the regular expression for the
 route at WP_JSON_Taxonomies->register_routes, one example:
 `/posts/types/(?P<type>\w+)/taxonomies/(?P<taxonomy>\w+)`
 doesn't cover taxonomies with hyphens.

 However this regex does work:
 `/posts/types/(?P<type>\w+)/taxonomies/(?P<taxonomy>[\w|\-]+)`

 Just to make it known.

 Thanks for the great job with this nice API.

 Regards,
 mijn.host Server Administrator
 https://mijn.host

-- 
Ticket URL: <https://gsoc.trac.wordpress.org/ticket/386>
WordPress GSoC Trac <https://gsoc.trac.wordpress.org/>
WordPress Google Summer of Code Trac


More information about the wp-gsoc mailing list