如何通过使用此代码添加分类? 当我点击新的分类,我得到一个错误自定义分类不工作在自定义后wordpress
function people_init() {
// create a new taxonomy
register_taxonomy(
'people',
'new_post',
array(
'label' => __('People'),
'rewrite' => array('slug' => 'person'),
'capabilities' => array(
'assign_terms' => 'edit_guides',
'edit_terms' => 'publish_guides'
)
)
);
}add_action('init', 'people_init');
这是错误消息:
你不允许编辑这个项目。
waao .. !!它的工作很好......谢谢先生。 不同的代码有什么问题。 – user3060132
此错误代码..?为什么.....。 '能力'=>数组( 'assign_terms'=> 'edit_guides', 'edit_terms'=> 'publish_guides' ) – user3060132
因为你已经通过错误的参数,就可以使用像 '能力'=>数组( ' assign_terms'=>'edit_posts', 'edit_terms'=>'manage_categories' ) –