elevati / wp-api-multiple-posttype
wp/v2/posts api 的扩展,允许查询多个文章类型
1.0.4
2018-07-12 14:07 UTC
Requires
- composer/installers: ~1.0
Requires (Dev)
- squizlabs/php_codesniffer: 2.3.4
- wp-coding-standards/wpcs: 0.6.0
This package is not auto-updated.
Last update: 2024-09-18 21:26:37 UTC
README
wp/v2/posts api 的扩展,允许查询多个文章类型
关于
想要获取您网站的文章、页面、文章、事件?
使用端点:'/wp-json/wp/v2/multiple-post-type'
列表
GET
请求到 /wp-json/wp/v2/multiple-post-type?&type[]=post&type[]=page
获取 slug 为 "about-me" 的页面
GET /wp-json/wp/v2/multiple-post-type?slug=about-me&type[]=post&type[]=page
搜索词 "awesome"
GET /wp-json/wp/v2/multiple-post-type?search=awesome&type[]=post&type[]=page&type[]=articles
鸣谢
使用 Ruben Vreeken 在 stackoverflow 上共享的代码构建,(https://github.com/Rayraz) (http://stackoverflow.com/questions/38059805/query-multiple-post-types-using-wp-rest-api-v2-wordpress)