Skip to content

Instantly share code, notes, and snippets.

Created January 20, 2016 15:10
Show Gist options
  • Save anonymous/965abff715d1d11c2fee to your computer and use it in GitHub Desktop.
Save anonymous/965abff715d1d11c2fee to your computer and use it in GitHub Desktop.
<?php
function ah_remove_menus()
{
global $menu;
global $current_user;
get_currentuserinfo();
if($current_user->user_login == 'username') // Betreffenden Namen einsetzen
{
$restricted = array(__('Posts'),
__('Media'),
__('Links'),
__('Pages'),
__('Comments'),
__('Appearance'),
__('Plugins'),
__('Users'),
__('Tools'),
__('Settings')
);
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}// end while
}// end if
}
add_action('admin_menu', 'ah_remove_menus');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment