user-switching.php
public static function maybe_switch_url( WP_User $user ) {
		$old_user = self::get_old_user();

		if ( $old_user && ( $old_user->ID === $user->ID ) ) {
			return self::switch_back_url( $old_user );
		} elseif ( current_user_can( 'switch_to_user', $user->ID ) ) {
			return self::switch_to_url( $user );
		} else {
			return false;
		}
	}
public static function maybe_switch_url( WP_User $user ) {
		$old_user = self::get_old_user();

		if ( $old_user && ( $old_user->ID === $user->ID ) ) {
			return self::switch_back_url( $old_user );
		} elseif ( current_user_can( 'switch_to_user', $user->ID ) ) {
			return self::switch_to_url( $user );
		} else {
			return false;
		}
	}
public static function maybe_switch_url ( WP_User $ user ) { $ old_user = self :: get_old_user ( ) ; if ( $ old_user && ( $ old_user -> ID === $ user -> ID ) ) { return self :: switch_back_url ( $ old_user ) ; } elseif ( current_user_can ( 'switch_to_user' , $ user -> ID ) ) { return self :: switch_to_url ( $ user ) ; } else { return false ; } }
Returns the switch to or switch back URL for a given user.

@param  WP_User $user The user to be switched to.
@return string|false The required URL, or false if there's no old user or the user doesn't have the required capability.
Returns the switch to or switch back URL for a given user .