About REST API

This support request was posted in General Support by ethonlau

Request ID #38632 Resolved
  • 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.

    Hi 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.

    Thanks 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!

    Hi,

    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.

    Thanks~It’s work.

    Perfect, thank you Ethon.

    Have a nice weekend,
    Juan.

Viewing 6 posts - 1 through 6 (of 6 total)

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server