| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Class 'WP_Speculation_Rules'.
| File Size: | 293 lines (8 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| add_rule( string $mode, string $id, array $rule ) X-Ref |
| Adds a speculation rule to the speculation rules to consider. param: string $mode Speculative loading mode. Either 'prefetch' or 'prerender'. param: string $id Unique string identifier for the speculation rule. param: array<string, mixed> $rule Associative array of rule arguments. return: bool True on success, false if invalid parameters are provided. |
| has_rule( string $mode, string $id ) X-Ref |
| Checks whether a speculation rule for the given mode and ID already exists. param: string $mode Speculative loading mode. Either 'prefetch' or 'prerender'. param: string $id Unique string identifier for the speculation rule. return: bool True if the rule already exists, false otherwise. |
| jsonSerialize() X-Ref |
| Returns the speculation rules data ready to be JSON-encoded. return: array<string, array<int, array<string, mixed>>> Speculation rules data. |
| is_valid_id( string $id ) X-Ref |
| No description |
| is_valid_mode( string $mode ) X-Ref |
| Checks whether the given speculation rules mode is valid. param: string $mode Speculation rules mode. return: bool True if valid, false otherwise. |
| is_valid_eagerness( string $eagerness ) X-Ref |
| Checks whether the given speculation rules eagerness is valid. param: string $eagerness Speculation rules eagerness. return: bool True if valid, false otherwise. |
| is_valid_source( string $source ) X-Ref |
| Checks whether the given speculation rules source is valid. param: string $source Speculation rules source. return: bool True if valid, false otherwise. |
| Generated : Mon May 25 08:20:05 2026 | Cross-referenced by PHPXref |