About REST API
This support request was posted in General Support by ethonlau
- ethonlau February 21, 2019 at 2:33 pm
Hi,
I bought Flatbase theme, and I need to use WordPress’ REST API: https://developer.wordpress.org/rest-api/
I need to use REST API to build an app, get the posts and search. But I found, in Flatbase, I should add new in “Articles”, but not native “Posts”. So “Posts” is empty, the Rest API can not use. How can I fix it?
Thank you.
Ethon.
Juanfra Aldasoro February 21, 2019 at 6:32 pmHi Ethon,
Thanks for reaching out!
Yes, the articles are not posts but a custom post type. In order to have custom post types work with the REST API you’ll need to add a flag when registering the post type: https://v2.wp-api.org/extending/custom-content-types/
This is a pretty great feature to include in the next version, but unfortunately not part of the theme yet.
Best,
Juan.ethonlau February 22, 2019 at 4:07 amThanks for reply.
When will the version include this feature be released? Or how can I support this custom post types in REST API manually now?
If there is no way out, I need to consider change another theme, because I need to use it recently. Hope can get your reply or help. Thank you so much!
Juanfra Aldasoro February 22, 2019 at 12:35 pmHi,
Thank you for the follow-up.
We don’t have a specific target date for the next release yet.
The place where the custom post type is registered: /flatbase/includes/custom-post-types/article/article.php
You can try modifying that with what they suggest to do for having computability with the rest API here: https://v2.wp-api.org/extending/custom-content-types/
Best,
Juan.
This topic is marked as resolved
Only the topic author can re-open this thread.