Filters domains and URLs for resource preloads.
Parameters
$preload_resources
array- Array of resources and their attributes, or URLs to print for resource preloads.
...$0
arrayArray of resource attributes.href
stringURL to include in resource preloads. Required.as
stringHow the browser should treat the resource (script
,style
,image
,document
, etc).crossorigin
stringIndicates the CORS policy of the specified resource.type
stringType of the resource (text/html
,text/css
, etc).media
stringAccepts media types or media queries. Allows responsive preloading.imagesizes
stringResponsive source size to the source Set.imagesrcset
stringResponsive image sources to the source set.fetchpriority
stringFetchpriority value for the resource.
Source
$preload_resources = apply_filters( 'wp_preload_resources', array() );
Changelog
User Contributed Notes
You must log in before being able to contribute a note or feedback.
This is how you could use the
wp_preload_resources
filter to preload your theme styles.