apply_filters( 'wp_resource_hints', array $urls, string $relation_type )

Filters domains and URLs for resource hints of relation type.


Parameters

$urls

Array of resources and their attributes, or URLs to print for resource hints.<br>

  • '...$0'
    (array|string) Array of resource attributes, or a URL string.<br>
    • 'href'
      (string) URL to include in resource hints. Required.<br>
    • 'as'
      (string) How the browser should treat the resource (script, style, image, document, etc).<br>
    • 'crossorigin'
      (string) Indicates the CORS policy of the specified resource.<br>
    • 'pr'
      (float) Expected probability that the resource hint will be used.<br>
    • 'type'
      (string) Type of the resource (text/html, text/css, etc).<br>

$relation_type

The relation type the URLs are printed for, e.g. 'preconnect' or 'prerender'.


Source

File: wp-includes/general-template.php

View on GitHub



Changelog

Changelog
Version Description
4.7.0 The $urls parameter accepts arrays of specific HTML attributes as its child elements.
4.6.0 Introduced.