https://github.com/elevati/wp-api-multiple-posttype
wordpress wp rest api v2 extension of wp/v2/posts api to allow query multiple post types
https://github.com/elevati/wp-api-multiple-posttype
rest-api v2 wordpress-plugin wp-api
Last synced: 1 day ago
JSON representation
wordpress wp rest api v2 extension of wp/v2/posts api to allow query multiple post types
- Host: GitHub
- URL: https://github.com/elevati/wp-api-multiple-posttype
- Owner: elevati
- License: gpl-3.0
- Created: 2017-02-07T14:22:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-22T10:43:48.000Z (over 7 years ago)
- Last Synced: 2025-12-28T21:24:51.424Z (3 months ago)
- Topics: rest-api, v2, wordpress-plugin, wp-api
- Language: PHP
- Size: 31.3 KB
- Stars: 47
- Watchers: 5
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Multiple Content type Query API for Wordpress Rest Api V2
Extension of wp/v2/posts api to allow query multiple post types
## About
Want to get your site's posts, pages, articles, events?
Use the Endpoint: '/wp-json/wp/v2/multiple-post-type'
List:
`GET` request to `/wp-json/wp/v2/multiple-post-type?&type[]=post&type[]=page`
Get the page with slug "about-me":
`GET /wp-json/wp/v2/multiple-post-type?slug=about-me&type[]=post&type[]=page`
Search term "awesome":
`GET /wp-json/wp/v2/multiple-post-type?search=awesome&type[]=post&type[]=page&type[]=articles`
## Credits
Build using the code shared by Ruben Vreeken, (https://github.com/Rayraz)
on stackoverflow (http://stackoverflow.com/questions/38059805/query-multiple-post-types-using-wp-rest-api-v2-wordpress)
## License
[GPL-3.0-or-later](http://www.gnu.org/licenses/gpl-3.0.html)