Created
          October 19, 2015 01:56 
        
      - 
      
- 
        Save yudiqing/42dc395b8206502d5a10 to your computer and use it in GitHub Desktop. 
    remove-admin-set-for-all-administrators-except-one
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | add_action('admin_menu', 'remove_admin_menu_links'); | |
| function remove_admin_menu_links(){ | |
| $user = wp_get_current_user(); | |
| if( $user && isset($user->user_email) && $user->user_email !== '[email protected]' ) { | |
| //replace [email protected] with the email address for whom you want to retain the pages. | |
| remove_menu_page('tools.php'); | |
| remove_menu_page('themes.php'); | |
| remove_menu_page('options-general.php'); | |
| remove_menu_page('plugins.php'); | |
| remove_menu_page('users.php'); | |
| remove_menu_page('edit-comments.php'); | |
| remove_menu_page('page.php'); | |
| remove_menu_page('upload.php'); | |
| remove_menu_page( 'edit.php?post_type=page' ); | |
| remove_menu_page( 'edit.php?post_type=videos' ); | |
| remove_menu_page( 'edit.php' ); | |
| //adjust the list of remove_menu_page as necessary. | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment