• In create_initial_rest_routes (hooked on rest_api_init) for post-types that are not attachments, autosave routes are registered.
    There doesn’t seem to be a great way to prevent that registration.
    When a new CPT is registered one of the registration arguments is rest_controller_class with the intent to override the WP_REST_Posts_Controller.

    I would like to either avoid registering or override the autosave class.
    Aside from filtering rest_endpoints, is there a good way to do that I’m missing?

    Thanks!
    Gary

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hi, sorry you haven’t had any responses to this. Have you found a better way to do this? Why is it important to not auto-save your post type?

    I suppose you could register your post type with 'show_in_rest'=>false,, then register the necessary routes yourself. Just a thought, untested.

Viewing 1 replies (of 1 total)
  • The topic ‘extending WP_REST_Autosaves_Controller’ is closed to new replies.