SHARE
TWEET

Untitled

a guest Mar 20th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $user = new WP_User( 'Y' );
  2. $user->remove_cap('edit_plugins');
  3.    
  4. add_action('init', 'remove_specific_admin_cap');
  5. function remove_specific_admin_cap(){
  6. $user = wp_get_current_user();
  7. if( $user && isset($user->user_email) && 'user@email.com' == $user->user_email ) {
  8. $role = get_role( 'administrator' );
  9. $role->remove_cap( 'edit_plugins' );
  10.  
  11.     }
  12. }
RAW Paste Data
Top