Issue on WP Rest for Custom Post Types

  • servetoz
    Participant
    # 1 week, 5 days ago

    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: http://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
    # 1 week, 5 days ago

    What actions trigger this error?

    servetoz
    Participant
    # 1 week, 5 days ago

    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
    # 1 week, 5 days ago

    Do you use a plugin to manage your post type?

    servetoz
    Participant
    # 1 week, 5 days ago

    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
    # 1 week, 5 days ago

    Good

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

You must be logged in to reply to this topic.