WP_Speculation_Rules::is_valid_id( string $id ): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Checks whether the given ID is valid.

Parameters

$idstringrequired
Unique string identifier for the speculation rule.

Return

bool True if the ID is valid, false otherwise.

Source

private function is_valid_id( string $id ): bool {
	return (bool) preg_match( '/^[a-z][a-z0-9_-]+$/', $id );
}

Changelog

VersionDescription
6.8.0Introduced.

User Contributed Notes

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