Changing REST API Namespace

Support MB Custom Post Type Changing REST API NamespaceResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10524
    Austin PassyAustin Passy
    Participant

    Is there a way to filter the namespace prefix for registered post types? The WordPress namespace shouldn't be used for CPTs outside of core.

    #10532
    Anh TranAnh Tran
    Keymaster

    Hi Austin,

    If you just enable show_in_rest param for a CPT, it will use the default WordPress namespace, which is wp/v2. In order to use a custom namespace, you have to write a custom REST Controller (which is out of the scope of the extension). Please see here for more details.

    Update: In case you write a custom REST Controller, you might disable the rest support in the MB Custom Post Type extension, and add a custom code like this.

    #10556
    Austin PassyAustin Passy
    Participant

    That's what I figured. Just wanted to verify.

    If that is ever a priority, I would suggest implementing that option since using the WordPress namespace isn't advised.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.