elevati / wp-api-multiple-posttype

wp/v2/posts api 的扩展,允许查询多个文章类型

安装量: 14,046

依赖关系: 0

建议者: 0

安全: 0

星标: 47

关注者: 6

分支: 7

开放问题: 3

类型:wordpress-plugin

1.0.4 2018-07-12 14:07 UTC

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)

许可证

GPL-3.0-or-later