【发布时间】:2019-10-25 14:56:39
【问题描述】:
是否可以使用 url 作为参数从 wordpress rest api 获取帖子数据/类型?
我已经从 soundcloud 知道了这个功能。有一个带有 url 参数的解析函数(请参阅https://developers.soundcloud.com/docs/api/reference#resolve)。当你调用这个 rest api 端点时,如果 url 是一个曲目或播放列表,你会得到详细的信息。
不幸的是,我在 wordpress rest api 文档中找不到执行此操作的函数。我真正想要的是通过只知道 url 来获取帖子数据/类型
- https://demo.wp-api.org/2017/05/23/hello-world/ => 发帖
- https://demo.wp-api.org/example => 页面
- https://demo.wp-api.org/category/example => 类别
有了这样的功能 https://demo.wp-api.org/wp-json/wp/v2/resolve?url=https://demo.wp-api.org/2017/05/23/hello-world/
有没有办法做到这一点?还是我需要使用 wordpress 插件编写自己的 rest api 端点?
【问题讨论】: