mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-23 20:54:24 +00:00
Script Loader: Remove default DNS prefetch entry for s.w.org.
A default DNS prefetch entry for s.w.org was previously included to save a few ms in case an emoji is used that is not supported by the browser. It appears this use case doesn't justify a prefetch to s.w.org on every WordPress website. This changesets removes `emoji_svg_url` prefetch from `wp_resource_hints()`. It also updates unit tests in `Tests_General_wpResourceHints` by removing `test_should_have_defaults_on_frontend()` entirely and removing s.w.org prefetch from expected output of ten other test functions. Plugin authors can use the `wp_resource_hints` filter if they need to re-add the DNS prefetch entry for s.w.org. Follow-up to [37920], [38122]. Props joelhardi, superpoincare, jhabdas, garrett-eclipse, sabernhardt, SergeyBiryukov. Fixes #40426. See #37387. git-svn-id: https://develop.svn.wordpress.org/trunk@53904 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3317,13 +3317,6 @@ function wp_resource_hints() {
|
||||
'prerender' => array(),
|
||||
);
|
||||
|
||||
/*
|
||||
* Add DNS prefetch for the Emoji CDN.
|
||||
* The path is removed in the foreach loop below.
|
||||
*/
|
||||
/** This filter is documented in wp-includes/formatting.php */
|
||||
$hints['dns-prefetch'][] = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/13.0.0/svg/' );
|
||||
|
||||
foreach ( $hints as $relation_type => $urls ) {
|
||||
$unique_urls = array();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user