Checks whether the given ID is valid.
Parameters
$id
stringrequired- Unique string identifier for the speculation rule.
Source
private function is_valid_id( string $id ): bool {
return (bool) preg_match( '/^[a-z][a-z0-9_-]+$/', $id );
}
Changelog
Version | Description |
---|---|
6.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.