I use wordpress theme called Dreamland which has defefined some custom post types and taxonomies. I want to change permalink structure for omit slug in in url. Almost every solution I've found is based on rewrite parameter on register_post_type() function. I tried to change it directly on place where that custom post type is registered or by register_post_type_args filter like this:
function custom_post_type_args( $args, $post_type ) {
if ( $post_type == "bunch_property" ) {
$args['rewrite'] = array(
'slug' => ''
);
}
return $args;
}
add_filter( 'register_post_type_args', 'custom_post_type_args', 999, 2 );
It was always ended with 404 error. The important information is that only allowed slug is "property" although real slug of this post type is "bunch_property". I had same problem with its taxonomy called "property_category" but I solved it by this solution. Is there also anything like it for post type instead of taxonomy? Or any different solution except rewrite rule on .htaccess?