首先,选择一个wordpress角色:作者、撰稿人、编辑。。。或自定义角色。
然后根据您的职能定制您所选的角色。php主题文件:
if ( ! function_exists( \'writer_set_roles\' ) ):
function writer_set_roles()
{
global $wp_roles;
// post / page editing
$wp_roles->add_cap(\'author\',\'edit_others_pages\');
$wp_roles->add_cap(\'author\',\'edit_published_pages\');
$wp_roles->add_cap(\'author\',\'edit_private_pages\');
$wp_roles->add_cap(\'author\',\'publish_pages\');
$wp_roles->add_cap(\'author\',\'delete_pages\');
$wp_roles->add_cap(\'author\',\'delete_others_pages\');
$wp_roles->add_cap(\'author\',\'delete_others_posts\');
$wp_roles->add_cap(\'author\',\'delete_published_pages\');
$wp_roles->add_cap(\'author\',\'manage_categories\');
// appearance
$wp_roles->add_cap(\'author\',\'edit_themes\');
$wp_roles->add_cap(\'author\',\'edit_theme_options\');
$wp_roles->add_cap(\'author\',\'manage_widgets\');
$wp_roles->add_cap(\'author\',\'edit_widgets\');
// sample for plugin caps
$wp_roles->add_cap(\'author\',\'NextGEN Gallery overview\');
$wp_roles->add_cap(\'author\',\'NextGEN Use TinyMCE\');
$wp_roles->add_cap(\'author\',\'NextGEN Upload images\');
$wp_roles->add_cap(\'author\',\'NextGEN Manage gallery\');
$wp_roles->add_cap(\'author\',\'NextGEN Manage others gallery\');
}
endif;
add_action( \'after_setup_theme\', \'writer_set_roles\' );
您应该在此文件中找到所有容量:
https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/schema.php或在文档中。https://codex.wordpress.org/Roles_and_Capabilities