admin管理员组文章数量:1279213
I wanted to get the Post ID of a post from another website, but it was not in the url, but it was in the Response Header.
When I output the Response Header, the Post ID does not appear on the output. Do you have a solution for getting the Post ID ?
I wanted to get the Post ID of a post from another website, but it was not in the url, but it was in the Response Header.
When I output the Response Header, the Post ID does not appear on the output. Do you have a solution for getting the Post ID ?
Share Improve this question asked Nov 15, 2021 at 19:08 markazfa irmarkazfa ir 1 2 |1 Answer
Reset to default 2WordPress's REST API should provide the information you need.
If you're after a post with the slug the-slug-you-want
, then you can request the data about any post(s) with that slug using the URL https://example/wp-json/v2/posts/?slug=the-slug-you-want
. This returns the post(s) with that slug, and in the post's/posts' JSON objects the ID is available.
本文标签: Find the Post ID of a post from another website
版权声明:本文标题:Find the Post ID of a post from another website 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741218766a2360559.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
https://example/wp-json/v2/posts/?slug=the-slug-you-want
would return the post(s) with that slug, and in the post's/posts' JSON objects the ID is available. – Pat J Commented Nov 15, 2021 at 19:26