Custom Fields
Re-Envisioned
Support MB Custom Post Type Changing REST API Namespace

This topic contains 2 replies, has 2 voices, and was last updated by  Austin Passy 5 days, 13 hours ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10524

    Austin 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 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 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.