WP HOOKS
filtrod 6.1.0

wp_preload_resources

Args 1Plik wp-includes/general-template.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters domains and URLs for resource preloads.

Parametry

ParametrTypOpis
$preload_resourcesarray{ Array of resources and their attributes, or URLs to print for resource preloads. @type array ...$0 { Array of resource attributes. @type string $href URL to include in resource preloads. 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 string $type Type of the resource (<code>text/html</code>, <code>text/css</code>, etc). @type string $media Accepts media types or media queries. Allows responsive preloading. @type string $imagesizes Responsive source size to the source Set. @type string $imagesrcset Responsive image sources to the source set. @type string $fetchpriority Fetchpriority value for the resource. } }

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'wp_preload_resources', 'twoja_funkcja' );

function twoja_funkcja($param_1) {
	// Twój kod
}

Popularne w tej kategorii