Created
October 12, 2020 13:19
-
-
Save ajmaurya99/b647a63b1b648aa58385c5d5d293cdf5 to your computer and use it in GitHub Desktop.
WordPress Disable Emojis DNS Prefetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable Emojis DNS Prefetch | |
* @return string | |
*/ | |
add_filter( 'wp_resource_hints', 'disable_emojis_dns_prefetch', 10, 2); | |
function disable_emojis_dns_prefetch( $urls, $relation_type ) { | |
if ( 'dns-prefetch' == $relation_type ) { | |
$emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2.2.1/svg/' ); | |
$urls = array_diff( $urls, array( $emoji_svg_url ) ); | |
} | |
return $urls; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment