• Resolved Zee

    (@laserjobs)


    https://kinsta.com/knowledgebase/disable-emojis-wordpress/

    add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
    
    /**
     * Remove emoji CDN hostname from DNS prefetching hints.
     *
     * @param array $urls URLs to print for resource hints.
     * @param string $relation_type The relation type the URLs are printed for.
     * @return array Difference betwen the two arrays.
     */
    function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {
     if ( 'dns-prefetch' == $relation_type ) {
     /** This filter is documented in wp-includes/formatting.php */
     $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' );
    
    $urls = array_diff( $urls, array( $emoji_svg_url ) );
     }
    
    return $urls;
    }
    • This topic was modified 6 years, 11 months ago by Zee.
    • This topic was modified 6 years, 11 months ago by Zee.
    • This topic was modified 6 years, 11 months ago by Zee.
    • This topic was modified 6 years, 11 months ago by Zee.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding disable Emoji DNS prefetch to Disable Emoji script?’ is closed to new replies.