Make WordPress Core


Ignore:
Timestamp:
06/29/2016 07:35:27 PM (8 years ago)
Author:
ocean90
Message:

Script Loader: Introduce an API to register resource hints.

Resource hints allow browsers to prefetch specific pages or render them in the background to perform DNS lookups or to begin the connection handshake (DNS, TCP, TLS) in the background.

By default, wp_resource_hints() prints hints for "s.w.org" (the WordPress.org CDN) and for all scripts and styles which are enqueued from external hosts.
Use the wp_resource_hints filter to add custom domains and URLs for dns-prefetch, preconnect, prefetch or prerender.

Props voldemortensen, swissspidy.
Fixes #34292.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r37915 r37920  
    240240add_action( 'wp_head',             'wp_generator'                           );
    241241add_action( 'wp_head',             'rel_canonical'                          );
     242add_action( 'wp_head',             'wp_resource_hints'                      );
    242243add_action( 'wp_head',             'wp_shortlink_wp_head',            10, 0 );
    243244add_action( 'wp_head',             'wp_site_icon',                    99    );
Note: See TracChangeset for help on using the changeset viewer.