Remove caps
-
Is possible remove “upgrade_core” cap from specific administrator?
I try:function admin_security() { $adminID = get_current_user_id(); $userCap = new WP_User($adminID); if ( $adminID != 1 ) { $userCap->remove_cap( 'update_core' ); $userCap->remove_cap( 'update_plugins' ); $userCap->remove_cap( 'update_themes' ); $userCap->remove_cap( 'install_plugins' ); $userCap->remove_cap( 'install_themes' ); $userCap->remove_cap( 'delete_themes' ); $userCap->remove_cap( 'delete_plugins' ); $userCap->remove_cap( 'edit_plugins' ); $userCap->remove_cap( 'edit_themes' ); $userCap->remove_cap( 'switch_themes' ); $userCap->remove_cap( 'remove_users' ); $userCap->remove_cap( 'activate_plugins' ); } } add_action( 'admin_init', 'admin_security' );
In this situation i’m trying to keep certain caps only for administrator ID 1.
But not success =(Note: I have good reasons to need to do so.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Remove caps’ is closed to new replies.