Checks whether a speculation rule for the given mode and ID already exists.
Parameters
$mode
stringrequired- Speculative loading mode. Either
'prefetch'
or'prerender'
. $id
stringrequired- Unique string identifier for the speculation rule.
Source
public function has_rule( string $mode, string $id ): bool {
return isset( $this->rules_by_mode[ $mode ][ $id ] );
}
Changelog
Version | Description |
---|---|
6.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.