WP_Speculation_Rules::is_valid_mode( mixed $mode ): bool

In this article

Checks whether the given speculation rules mode is valid.

Parameters

$modemixedrequired
Speculation rules mode.

Return

bool True if valid, false otherwise.

Source

public static function is_valid_mode( $mode ): bool {
	return is_string( $mode ) && isset( self::$mode_allowlist[ $mode ] );
}

Changelog

VersionDescription
7.1.0The $mode param now allows mixed and not just string.
6.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.