• Resolved marcusdeman

    (@marcusdeman)


    I’m getting this error message and I think it is related to CPT UI?

    Notice: Function register_rest_route was called incorrectly. The REST API route definition for news/get is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. 

    Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /www/website/public/wp/wp-includes/functions.php on line 6121

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @marcusdeman

    Did you customize the REST-based fields for this given post type at all? or did you leave them all defaults/empty?

    Thread Starter marcusdeman

    (@marcusdeman)

    I just realized where this is coming from. “News” is already an existing CPT registered via php.

    How am I able to define it in CPT UI as well? When I do that, I get this message:

    “Please choose a different post type name. news matches an existing page slug, which can cause conflicts.”

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You should have a “I’m trying to migrate things in to CPTUI, let me save this” checkbox below the singular label, that will allow you to save anyway.

    Thread Starter marcusdeman

    (@marcusdeman)

    I have selected that option but still getting the same error message…

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I think we need to patch up some small js bugs.

    In the meantime, you could temporarily comment out the current post type registration spot so that it’s momentarily not registered, so that you could save the same within CPTUI.

    Thread Starter marcusdeman

    (@marcusdeman)

    Yes I’ve tried commenting out the post type registration as well but CPT UI still shows the same error message unfortunately.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Ahh, I mis-read a bit with the last error you presented. that error is indicating you have a page named “news” already, not a conflicting post type at the moment.

    I think the best workaround we have for that, if really wanted, is renaming the page slug temporarily, saving the post type in CPTUI, and then re-renaming the page back to where it was.

    However, there’s some risk with doing that because URLs may or may not be interpreted as child pages rather than posts in their intended post type.

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

The topic ‘Function register_rest_route was called incorrectly.’ is closed to new replies.