W3cubDocs

/WordPress

apply_filters( ‘wp_preload_resources’, array $preload_resources )

Filters domains and URLs for resource preloads.

Parameters

$preload_resourcesarray
Array of resources and their attributes, or URLs to print for resource preloads.
  • ...$0 array
    Array of resource attributes.
    • href string
      URL to include in resource preloads. Required.
    • as string
      How the browser should treat the resource (script, style, image, document, etc).
    • crossorigin string
      Indicates the CORS policy of the specified resource.
    • type string
      Type of the resource (text/html, text/css, etc).
    • media string
      Accepts media types or media queries. Allows responsive preloading.
    • imagesizes string
      Responsive source size to the source Set.
    • imagesrcset string
      Responsive image sources to the source set.
    • fetchpriority string
      Fetchpriority value for the resource.

    Source

    $preload_resources = apply_filters( 'wp_preload_resources', array() );
    

    Changelog

    Version Description
    6.6.0 Added the $fetchpriority attribute.
    6.1.0 Introduced.

You must log in before being able to contribute a note or feedback.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_preload_resources