[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> class-wp-speculation-rules.php (summary)

Class 'WP_Speculation_Rules'.

File Size: 293 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  add_rule()
  has_rule()
  jsonSerialize()
  is_valid_id()
  is_valid_mode()
  is_valid_eagerness()
  is_valid_source()

Functions
Functions that are not part of a class:

add_rule( string $mode, string $id, array $rule )   X-Ref
Adds a speculation rule to the speculation rules to consider.

return: bool True on success, false if invalid parameters are provided.
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.

has_rule( string $mode, string $id )   X-Ref
Checks whether a speculation rule for the given mode and ID already exists.

return: bool True if the rule already exists, false otherwise.
param: string $mode Speculative loading mode. Either 'prefetch' or 'prerender'.
param: string $id   Unique string identifier for the speculation rule.

jsonSerialize()   X-Ref
Returns the speculation rules data ready to be JSON-encoded.

return: array<string, 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.

return: bool True if valid, false otherwise.
param: string $mode Speculation rules mode.

is_valid_eagerness( string $eagerness )   X-Ref
Checks whether the given speculation rules eagerness is valid.

return: bool True if valid, false otherwise.
param: string $eagerness Speculation rules eagerness.

is_valid_source( string $source )   X-Ref
Checks whether the given speculation rules source is valid.

return: bool True if valid, false otherwise.
param: string $source Speculation rules source.



Generated : Fri Feb 21 08:20:01 2025 Cross-referenced by PHPXref