如何让add\\u操作在函数中工作,我想隐藏一些管理菜单项,但不让用户和编辑器。
function my_remove_menu_pages() {
remove_menu_page(\'tools.php\');
remove_menu_page(\'themes.php\');
remove_menu_page(\'options-general.php\');
remove_menu_page(\'plugins.php\');
}
add_action(\'admin_init\', \'check_username\');
function check_username()
{
$user = wp_get_current_user();
if($user && isset($user->user_email) && \'[email protected]\' == $user->user_email)
{
add_action( \'admin_menu\', \'my_remove_menu_pages\' );
}
}