WP_Speculation_Rules::is_valid_sourcepublic staticWP 6.8.0

Checks whether the given speculation rules source is valid.

Method of the class: WP_Speculation_Rules{}

No Hooks.

Returns

true|false. True if valid, false otherwise.

Usage

$result = WP_Speculation_Rules::is_valid_source( $source ): bool;
$source(string) (required)
Speculation rules source.

Changelog

Since 6.8.0 Introduced.

WP_Speculation_Rules::is_valid_source() code WP 7.0

public static function is_valid_source( string $source ): bool {
	return isset( self::$source_allowlist[ $source ] );
}