Issue on WP Rest for Custom Post Types

  • servetoz
    Participant
    4 years, 5 months ago #15621

    Hi,

    Custom Post types cannot be saved after plugin activation. I get this error:
    {“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}

    Request URL: https://localhost:8080/wp-json/wp/v2/event/358?_locale=user
    Request Method: POST
    Status Code: 404 Not Found
    Remote Address: [::1]:8080
    Referrer Policy: strict-origin-when-cross-origin

    If I deactivate the plugin, everthings is fine.
    Can you please check it what am I doing wrong?

    wpsolr
    Keymaster
    4 years, 5 months ago #15622

    What actions trigger this error?

    servetoz
    Participant
    4 years, 5 months ago #15623

    When I try to publish or update my custom post types. I get this error.
    This error appears gutenberg editor tries to get updated post info after post update.
    But I can update standart wordpress posts.

    Here is the SS:

    View post on imgur.com

    wpsolr
    Keymaster
    4 years, 5 months ago #15624

    Do you use a plugin to manage your post type?

    servetoz
    Participant
    4 years, 5 months ago #15625

    I found the problem. I registered post types on wp_loaded.
    On same event plugin tries to read these posts before they are ready, when I changed wp_loaded -> init, it is fixed.

    Thanks anyway.
    Have a nice day

    wpsolr
    Keymaster
    4 years, 5 months ago #15626

    Good

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

You must be logged in to reply to this topic.