Custom Fields
Support MB Custom Post Type Changing REST API Namespace

  • Creator
  • #10524
    Resolved Austin Passy

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #10532
    Anh Tran

    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.

    Austin Passy

    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 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.