【发布时间】:2020-07-26 06:22:16
【问题描述】:
我想显示来自 WordPress REST API 的帖子,这是我想在我的案例中显示的自定义帖子类型:
我有来自 REST API 的单个自定义帖子类型帖子,重点是从 REST 获取分类术语,例如
...
"wp:term": [
{
"taxonomy": "examplestatus",
"embeddable": true,
"href": "domain.com/wp-json/wp/v2/category?post=217"
}
]
...
我可以得到一个示例术语,但我必须为"href" 部分创建一个新请求,它可以是健壮的。如何以不同的方式解决?新领域?注册一:https://developer.wordpress.org/reference/functions/register_rest_field/
谢谢!
【问题讨论】:
标签: wordpress wordpress-rest-api