Get Post Types
This endpoint gets all active post types, this means all post types that either have published posts OR post types added through the "default-post-types". It will return an array of the post types active.
The endpoint is "get/postTypes". Here's an example:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch(`www.mysite.com/api/get/postTypes/`) | |
| .then((blob) => { | |
| return blob.json() | |
| }) | |
| .then((data) => { | |
| // This will print out an array of the different post types | |
| console.log(data.content) | |
| }) |