filtrod 4.6.0
wp_resource_hints
Opis — z kodu źródłowego
Filters domains and URLs for resource hints of the given relation type.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$urls | array | { Array of resources and their attributes, or URLs to print for resource hints. @type array|string ...$0 { Array of resource attributes, or a URL string. @type string $href URL to include in resource hints. Required. @type string $as How the browser should treat the resource (<code>script</code>, <code>style</code>, <code>image</code>, <code>document</code>, etc). @type string $crossorigin Indicates the CORS policy of the specified resource. @type float $pr Expected probability that the resource hint will be used. @type string $type Type of the resource (<code>text/html</code>, <code>text/css</code>, etc). } } |
$relation_type | string | The relation type the URLs are printed for. One of 'dns-prefetch', 'preconnect', 'prefetch', or 'prerender'. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_resource_hints', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_resource_hints', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii