WordPress at Your Fingertips
filter is not described

wp_resource_hints filter-hook . WP 4.6.0

Filters domains and URLs for resource hints of relation type.


add_filter( 'wp_resource_hints', 'filter_function_name_4237', 10, 2 );
function filter_function_name_4237( $urls, $relation_type ){
	// filter...

	return $urls;

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

  • ...$0(array|string)
    Array of resource attributes, or a URL string.

    • href(string)
      URL to include in resource hints. 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.

    • pr(float)
      Expected probability that the resource hint will be used.

    • type(string)
      Type of the resource (text/html, text/css, etc).
The relation type the URLs are printed for, e.g. 'preconnect' or 'prerender'.


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

Where the hook is called

wp-includes/general-template.php 3317
$urls = apply_filters( 'wp_resource_hints', $urls, $relation_type );

Where in WP core the hook is used WordPress

Usage not found.