To get a taxonomy, using WP-API, you should make a request to http://example.com/wp-json/taxonomies/category/

All is well, until you have a taxonomy with a dash(‘-‘) in its name – in my case, the taxonomy is called ‘event-categories’ – the default event taxonomy in the Events Manager plugin.

So, a request to http://example.com/wp-json/taxonomies/event-categories/ responds with a “No route was found matching the URL and request method” message.

It’s a pretty big, apparently known issue, and will hopefully be resolved soon. In case it’s not though, here is a temporary solution, stolen from GitHub user zkingdesign on this page:

 

Leave a comment

Your email address will not be published. Required fields are marked *