Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress选项页多个权限_Php_Wordpress - Fatal编程技术网

Php Wordpress选项页多个权限

Php Wordpress选项页多个权限,php,wordpress,Php,Wordpress,您好,我有一个word press options页面,我想让所有编辑或以上级别的用户都可以查看该页面。我的代码如下: add_menu_page('example', 'example', 'editor', __FILE__, array('example', 'example')); 我尝试过多次使用不同的用户角色粘贴,甚至用逗号分隔每个用户角色,但都不起作用。这可能吗 相反,使用 if(current_user_can('editor')){ add_menu_page(...

您好,我有一个word press options页面,我想让所有编辑或以上级别的用户都可以查看该页面。我的代码如下:

add_menu_page('example', 'example', 'editor', __FILE__, array('example', 'example'));
我尝试过多次使用不同的用户角色粘贴,甚至用逗号分隔每个用户角色,但都不起作用。这可能吗

相反,使用

if(current_user_can('editor')){
    add_menu_page(..., 'editor', ....);
}elseif(current_user_can('someotherrole')){
    add_menu_page(..., 'someotherrole', ....);
}