最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to get all the terms from a custom hierarchical taxonomy via REST api?

programmeradmin1浏览0评论

This post can be a solution, but I guess there could be something more linear or native:

The official REST API guide is not really clear to me, and doesn't have much examples.

I've got a custom 'dealer_areas' taxonomy, hierarchical (continents > countries > regions).

I need to build a small js app based on that and, even if I could use the 'regular' admin-ajax way, this time I'd like to use the REST API instead.

I use / client (just to have some syntax sugar and pretty printing), but it could be any. If I ask for this, I get some terms, but not all:

http GET dev.example/my-site/wp-json/wp/v2/dealer_areas

I get terms from every nesting level, but not all.. And they're not returned based on post counts, so it really seems there's no logic in this.

Anyway, I'd like a direct way to get all the terms from all nesting levels (even empty ones).

Is there any or am I forced to create a custom route?

发布评论

评论列表(0)

  1. 暂无评论