删除已注册分类的URL重写

时间:2016-10-09 作者:Ivan Topić

根据this 有许多url重写不会减慢网站的速度。但是,当我注册分类法时,是否可以禁用生成这些重写?因为只有这一个CTP我有60个不必要的重写。

// Register CTP
$args = array(...)
register_post_type(\'my_ctp\', $args);

// Register 12 months as taxonomy for CTP (each of them have a few custom terms inside)
foreach($this->months as $month => $month_var) {
    $args = array(
        \'labels\' => array(\'name\' => $month),
        \'hierarchical\' => true,
        \'sort\' => true,

    /*  \'public\' => false,
        \'show_ui\' => false,
        \'show_in_nav_menus\' => false,
        \'query_var\' => false*/
        );
    register_taxonomy($month_var, \'my_ctp\', $args);     
}
这是一个重写一个自定义分类法的示例enter image description here

1 个回复
最合适的回答,由SO网友:mmm 整理而成

在参数中,尝试添加以下内容:

"rewrite" => FALSE,

相关推荐