Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress rest_no_route custom post type

//remove show_in_rest from. argument then this will work

$args = array(
    'hierarchical'          => true,
    'labels'                => $labels,
    'show_ui'               => true,
    'show_admin_column'     => true,
    'query_var'             => true,
    'rewrite'               => array( 'slug' => 'genre' ),
    'show_in_rest'          => true,  //remove
    'rest_base'             => 'genre',// remove
    'rest_controller_class' => 'WP_REST_Terms_Controller',//remove
  );
 
  register_taxonomy( 'genre', array( 'book' ), $args );
Source by developer.wordpress.org #
 
PREVIOUS NEXT
Tagged: #wordpress #custom #post #type
ADD COMMENT
Topic
Name
2+8 =