WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 45 | * @since 6.8.0 |
| 46 | * @see https://developer.chrome.com/docs/web-platform/prerender-pages |
| 47 | * |
| 48 | * @param array<string, string>|null $config Associative array with 'mode' and 'eagerness' keys, or `null`. The |
| 49 | * default value for both of the keys is 'auto'. Other possible values |
| 50 | * for 'mode' are 'prefetch' and 'prerender'. Other possible values for |
| 51 | * 'eagerness' are 'eager', 'moderate', and 'conservative'. The value |
| 52 | * `null` is used to disable speculative loading entirely. |
| 53 | */ |
| 54 | $config = apply_filters( 'wp_speculation_rules_configuration', $config ); |
| 55 | |
| 56 | // Allow the value `null` to indicate that speculative loading is disabled. |
| 57 | if ( null === $config ) { |
| 58 | return null; |
| 59 | } |
| 60 | |
| 61 | // Sanitize the configuration and replace 'auto' with current defaults. |
| 62 | $default_mode = 'prefetch'; |
| 63 | $default_eagerness = 'conservative'; |