我在wordpress中创建了一个角色add_role( string $role, string $display_name, array $capabilities = array() )
函数我想从$capabilities
是否允许其选择帖子模板?该选项位于“发布属性”部分下!
这是我的代码:
$capabilities = array(
"activate_plugins" => false,
"create_users" => false,
"delete_themes" => false,
"delete_users" => false,
"edit_files" => false,
"edit_plugins" => false,
"edit_theme_options" => false,
"edit_themes" => false,
"edit_users" => false,
"export" => false,
"import" => false,
"install_plugins" => false,
"install_themes" => false,
"list_users" => false,
"manage_options" => false,
"promote_users" => false,
"remove_users" => false,
"switch_themes" => false,
"update_core" => false,
"update_plugins" => false,
"update_themes" => false,
"edit_dashboard" => false,
"customize" => false,
"delete_site" => false,
"moderate_comments" => false,
"manage_categories" => false,
"manage_links" => false,
"edit_others_posts" => true,
"edit_pages" => false,
"edit_others_pages" => false,
"edit_published_pages" => false,
"publish_pages" => false,
"delete_pages" => false,
"delete_others_pages" => false,
"delete_published_pages" => false,
"delete_others_posts" => true,
"delete_private_posts" => true,
"edit_private_posts" => true,
"read_private_posts" => true,
"delete_private_pages" => false,
"edit_private_pages"=> false,
"read_private_pages" => false,
"unfiltered_html"=> false,
"edit_published_posts" => true,
"upload_files" => true,
"publish_posts" => true,
"delete_published_posts" => true,
"edit_posts" => true,
"delete_posts" => true,
"read" => true);
add_role( "parisa", "parisa", $capabilities );