• Resolved stldev

    (@stldev)


    Hey guys,

    we use the REST API Controller together with custom post types. Since a couple of days I cannot activate any REST endpoint with the plugin anymore. I use the REST API Controller in version 1.4.1. The wordpress versions I use it with are 4.9.9 and 5.0.3.

    Greets,
    Alex

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Alex,

    So you’re trying to turn on a custom post type and the setting won’t save? If that’s the case, do you know how the custom post type is being created?

    Our plugin changes a CPT’s show_in_rest value to true. I’m wondering if there are functions that are overriding our change and setting show_in_rest to false (i.e. we’re setting it to true and then whatever is defining your CPT is running and setting it back to false). Could that be the case?

    Let me know.

    Thank you,
    Kevin.

    Thread Starter stldev

    (@stldev)

    Hey Kevin,

    thanks for your answer. For creating the CPT I use this Plugin. I actually don’t know if there is an interference of the other plugin. But there was no update since 2 months for the other plugin and the REST API Controller worked a couple of days ago.

    After I save the settings in the Controller, I see the following response: “Settings have been successfully updated.”, but it’s deactivated.

    Greets,
    Alex

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Alex,

    Maybe the way in which you set up your latest CPT is different from the other ones? Can you check your CPT’s settings? I am not sure about the plugin you linked to but I know other similar plugins have settings for REST behavior. Can you make sure there isn’t anything disabling show_in_rest (or any similar sounding option) in your CPT’s definition?

    Edit: you should compare a working CPT and your new CPT that isn’t working. I have a feeling there is a difference (maybe intentional!) between the two. Looks for things related to REST, related to publicly queryable, etc.

    Cheers,
    Kevin.

    • This reply was modified 7 years, 2 months ago by yikesitskevin.
    Thread Starter stldev

    (@stldev)

    Hey Kevin,

    probably there is an interference with the CPT plugin. When I deactivate WP REST API Controller everything works fine and I can handle the REST endpoint directly within the CPT plugin. Thanks for your help anyway.

    Greets,
    Alex

    Hi @yikesitskevin

    I have exactly the same problem as described by @stldev. I have also installed the CPT UI plugin. For one custom post type i can perfectly enable the endpoints via the REST API controller, but not for another.

    I noticed that when creating a new CPT, i’m able to activate the endpoint via the REST API Controller at first, but as soon as i create one single post for that post type, the settings in the controller return back to ‘disabled’.

    When i disable the REST API Controller plugin, the previously unaccessible post type ist accessible again through the REST API.

    Thanks for any help.
    Thierry

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Thierry,

    I just installed the CPT UI plugin, made a post type (without changing any of the default CPT REST settings, so it was enable in rest by default), and it was automatically enabled in our plugin. This makes sense.

    Then I made a post of that post type and checked our plugin’s settings: it was still enabled.

    The CPT UI plugin has a lot of REST API options (all of the basic register_post_type() options, at least). Are you changing those? What are you defining as your REST settings for your CPT in the CPT UI plugin?

    Let me know.

    Thank you,
    Kevin.

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

The topic ‘Endpoint cannot be activated’ is closed to new replies.