Check these links below. 这是为您的pretty link插件管理菜单设置权限的地方:
pretty-link/prli-main.php -> line 16 - it\'s set to administrator
you want edit_posts
pretty-link/prli-main.php -> line 160 - it\'s set to $current_user->user_level >= 8
you want $current_user->user_level >= 7
What are your options?
OPTION 1 - Change the code
转到此确切链接(示例应为您的网站名称)并更改administrator
到edit_posts
:
http://example.com/wp-admin/plugin-editor.php?file=pretty-link/prli-main.php&a=te&scrollto=265
<转到此确切链接并更改
if($current_user->user_level >= 8)
到
if($current_user->user_level >= 7)
http://example.com/wp-admin/plugin-editor.php?file=pretty-link/prli-main.php&a=te&scrollto=2933
<保存更改
OPTION 2 - Override the code将以下内容添加到functions.php
添加管理菜单。如果您也需要仪表板小部件,而他们没有访问权限,只需对prli_add_dashboard_widgets
功能也一样。
remove_action(\'admin_menu\', \'prli_menu\');
add_action(\'admin_menu\', \'prli_menu_new\', 99999);
function prli_menu_new()
{
global $prli_options, $prlipro_options;
$role = \'edit_posts\';
if(isset($prlipro_options->min_role))
$role = $prlipro_options->min_role;
$prli_menu_hook = add_menu_page( __(\'Pretty Link | Manage Pretty Links\', \'pretty-link\'), __(\'Pretty Link\', \'pretty-link\'), $role, \'pretty-link\', \'PrliLinksController::route\', PRLI_IMAGES_URL.\'/pretty-link-small.png\' );
$prli_add_links_menu_hook = add_submenu_page( \'pretty-link\', __(\'Pretty Link | Add New Link\', \'pretty-link\'), __(\'Add New Link\', \'pretty-link\'), $role, \'add-new-pretty-link\', \'PrliLinksController::new_link\' );
add_submenu_page(\'pretty-link\', \'Pretty Link | Groups\', \'Groups\', $role, PRLI_PATH.\'/prli-groups.php\');
if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking != "count" )
add_submenu_page(\'pretty-link\', \'Pretty Link | Hits\', \'Hits\', $role, PRLI_PATH.\'/prli-clicks.php\');
add_submenu_page(\'pretty-link\', \'Pretty Link | Tools\', \'Tools\', $role, PRLI_PATH.\'/prli-tools.php\');
add_submenu_page(\'pretty-link\', \'Pretty Link | Options\', \'Options\', $role, PRLI_PATH.\'/prli-options.php\');
add_action(\'admin_head-pretty-link/prli-clicks.php\', \'prli_reports_admin_header\');
add_action(\'admin_print_scripts-\' . $prli_menu_hook, \'PrliLinksController::load_scripts\');
add_action(\'admin_print_scripts-\' . $prli_add_links_menu_hook, \'PrliLinksController::load_scripts\');
add_action(\'admin_head-pretty-link/prli-groups.php\', \'prli_groups_admin_header\');
add_action(\'admin_head-pretty-link/prli-options.php\', \'prli_options_admin_header\');
add_action(\'admin_print_styles-\' . $prli_menu_hook, \'PrliLinksController::load_styles\');
add_action(\'admin_print_styles-\' . $prli_add_links_menu_hook, \'PrliLinksController::load_styles\');
add_action(\'admin_head-\' . $prli_menu_hook, \'PrliLinksController::load_dynamic_scripts\', 100);
}
Option 3: You can also add these on an individual basis if you don\'t need to give them access to everything. For example:add_action( \'admin_menu\', \'pretty_links_override_action_edit_posts_role\', 99999 );
function pretty_links_override_action_edit_posts_role() {
$role = \'edit_posts\';
// remove them first
remove_menu_page( \'pretty-link\');
remove_submenu_page(\'pretty-link\', \'add-new-pretty-link\');
add_menu_page( __(\'Pretty Link | Manage Pretty Links\', \'pretty-link\'), __(\'Pretty Link\', \'pretty-link\'), $role, \'pretty-link\', \'PrliLinksController::route\', PRLI_IMAGES_URL.\'/pretty-link-small.png\' );
add_submenu_page( \'pretty-link\', __(\'Pretty Link | Add New Link\', \'pretty-link\'), __(\'Add New Link\', \'pretty-link\'), $role, \'add-new-pretty-link\', \'PrliLinksController::new_link\' );
}
Option 4: A plugin 尝试安装admin menu editor 或admin ui customize
Option 5: Premium
付费购买支持此功能的高级版本
Option 6: Hack premium options
硬代码$prlipro_options
. 虽然这对我来说最有意义,但在这里添加可能不合适,因为我会和插件作者发生冲突。