wordpress rest api v2 how to list taxonomy terms?

后端 未结 7 1845
情歌与酒
情歌与酒 2021-02-15 11:23

i am new to v2, i use v1 for long time, currently upgrade to v2, i try to get all the terms belong to specific custom taxonomy.

In v1 i can do this to get terms /taxonom

7条回答
  •  孤城傲影
    2021-02-15 11:55

    For custom taxonomies, be sure that you're setting the 'show_in_rest' argument to be true (default is false) in your register_taxonomy() call.

    The register_taxonomy() call is also where you can set the 'rest_base' argument (default will be the taxonomy name, /location_category/ in your example).

提交回复
热议问题