Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
I ended up extending the API like suggested in the comments to my question, although I was hoping there was a default route that fetched all posts of all post types. Apparently, there isn’t. So here’s my solution: add_action( ‘rest_api_init’, ‘custom_api_get_all_posts’ ); function custom_api_get_all_posts() { register_rest_route( ‘custom/v1’, ‘/all-posts’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘custom_api_get_all_posts_callback’ … Read more