user-switching.php
public function filter_map_meta_cap( array $required_caps, $cap, $user_id, array $args ) {
		if ( ( 'switch_to_user' === $cap ) && ( $args[0] === $user_id ) ) {
			$required_caps[] = 'do_not_allow';
		}
		return $required_caps;
	}
public function filter_map_meta_cap( array $required_caps, $cap, $user_id, array $args ) {
		if ( ( 'switch_to_user' === $cap ) && ( $args[0] === $user_id ) ) {
			$required_caps[] = 'do_not_allow';
		}
		return $required_caps;
	}
public function filter_map_meta_cap ( array $ required_caps , $ cap , $ user_id , array $ args ) { if ( ( 'switch_to_user' === $ cap ) && ( $ args [ 0 ] === $ user_id ) ) { $ required_caps [ ] = 'do_not_allow' ; } return $ required_caps ; }
Filters the required primitive capabilities for the given primitive or meta capability.

This is used to:
- Add the 'do_not_allow' capability to the list of required capabilities when a Super Admin is trying to switch
to themselves.

It affects nothing else as Super Admins can do everything by default.

@param string[] $required_caps Required primitive capabilities for the requested capability.
@param string   $cap           Capability or meta capability being checked.
@param int      $user_id       Concerned user ID.
@param array    $args {
Arguments that accompany the requested capability check.

@type mixed ...$0 Optional second and further parameters.
}
@return string[] Required capabilities for the requested action.
Filters the required primitive capabilities for the given primitive or meta capability .