admin管理员组文章数量:1424910
When I am querying for posts of a CPT, I get a response of 200 but a return of brackets [].
How can I show all of my CPT post data?
My syntax I am using in the url is: http://mydomain/wp-json/wp/v2/myCPT
When I am querying for posts of a CPT, I get a response of 200 but a return of brackets [].
How can I show all of my CPT post data?
My syntax I am using in the url is: http://mydomain/wp-json/wp/v2/myCPT
1 Answer
Reset to default 0So I tried everything and every plugin to fix my issue and expose the list CPT data instead of showing brackets [ ].
And the answer is something that might be a bug in Wordpress Rest API.
The problem was I am using custom statuses and none of my posts were assigned as default Wordpress status. After changing the posts to any of the default built-in statuses, it worked. But doesn't work for custom statuses it seems.... at least not with custom statuses created with a plugin called PublishPress.. Perhaps it just doesn't work with custom statuses at all, all-around
Hope this can help someone else!
本文标签: Issue with CPT posts within WP REST API showing as
版权声明:本文标题:Issue with CPT posts within WP REST API showing as [] 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745399384a2656965.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
'show_in_rest' => true,
when registering the post type? – czerspalace Commented Jun 14, 2019 at 23:57