У меня стоит простая задача, поменять url c vikatorr.ru/portfolio-view/aisuma/ на url такого вида vikatorr.ru/aisuma/ в произвольных типах записи. Однако я не смог найти в документации, как это настроить при помощи PHP.Подскажите, как это сделать для всего типа поста. В результате 404 http://vikatorr.ru/banksalen/
/* Portfolio */
function my_post_type_portfolio() {
register_post_type( 'portfolio',
array(
'label' => theme_locals("portfolio"),
'singular_label' => theme_locals("portfolio"),
'_builtin' => false,
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'hierarchical' => true,
'capability_type' => 'page',
'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png',
'rewrite' => FALSE,
'supports' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'custom-fields',
'comments')
)
);
register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'label' => theme_locals("categories"), 'singular_name' => theme_locals("category"), "rewrite" => true, "query_var" => true));
register_taxonomy('portfolio_tag', 'portfolio', array('hierarchical' => false, 'label' => theme_locals("tags"), 'singular_name' => theme_locals("tag"), 'rewrite' => true, 'query_var' => true));
}
add_action('init', 'my_post_type_portfolio');
global $wp_rewrite;
$projects_structure = '/%portfolio%/';
$wp_rewrite->add_rewrite_tag("%portfolio%", '([^/]+)', "\portfolio=");
$wp_rewrite->add_permastruct('portfolio', $projects_structure, True);