lib/User.php
protected function get_roles( $roles ) {
		if ( empty($roles) ) {
			// @codeCoverageIgnoreStart
			return null;
			// @codeCoverageIgnoreEnd
		}

		$wp_roles = wp_roles();
		$names    = $wp_roles->get_names();

		$values = array();

		foreach ( $roles as $role ) {
			$name = $role;
			if ( isset($names[ $role ]) ) {
				$name = translate_user_role($names[ $role ]);
			}
			$values[ $role ] = $name;
		}

		return $values;
	}
protected function get_roles( $roles ) {
		if ( empty($roles) ) {
			// @codeCoverageIgnoreStart
			return null;
			// @codeCoverageIgnoreEnd
		}

		$wp_roles = wp_roles();
		$names    = $wp_roles->get_names();

		$values = array();

		foreach ( $roles as $role ) {
			$name = $role;
			if ( isset($names[ $role ]) ) {
				$name = translate_user_role($names[ $role ]);
			}
			$values[ $role ] = $name;
		}

		return $values;
	}
protected function get_roles ( $ roles ) { if ( empty ( $ roles ) ) { // @codeCoverageIgnoreStart return null ; // @codeCoverageIgnoreEnd } $ wp_roles = wp_roles ( ) ; $ names = $ wp_roles -> get_names ( ) ; $ values = array ( ) ; foreach ( $ roles as $ role ) { $ name = $ role ; if ( isset ( $ names [ $ role ] ) ) { $ name = translate_user_role ( $ names [ $ role ] ) ; } $ values [ $ role ] = $ name ; } return $ values ; }
Creates an associative array with user role slugs and their translated names.

@internal
@since 1.8.5
@param array $roles user roles.
@return array|null
Creates an associative array with user role slugs and their translated names .