WordPress Version: 5.4
/**
*
* @global string $wp_version
* @staticvar bool $printed
*/
function print_emoji_detection_script()
{
global $wp_version;
static $printed = false;
if ($printed) {
return;
}
$printed = true;
$settings = array(
/**
* Filter the URL where emoji images are hosted.
*
* @since 4.2.0
*
* @param string The emoji base URL.
*/
'baseUrl' => apply_filters('emoji_url', 'https://s.w.org/images/core/emoji/72x72/'),
/**
* Filter the extension of the emoji files.
*
* @since 4.2.0
*
* @param string The emoji extension. Default .png.
*/
'ext' => apply_filters('emoji_ext', '.png'),
);
$version = 'ver=' . $wp_version;
if (SCRIPT_DEBUG) {
$settings['source'] = array(
/** This filter is documented in wp-includes/class.wp-scripts.php */
'wpemoji' => apply_filters('script_loader_src', includes_url("js/wp-emoji.js?{$version}"), 'wpemoji'),
/** This filter is documented in wp-includes/class.wp-scripts.php */
'twemoji' => apply_filters('script_loader_src', includes_url("js/twemoji.js?{$version}"), 'twemoji'),
);
?>
<script type="text/javascript">
window._wpemojiSettings = <?php
echo wp_json_encode($settings);
?>;
<?php
readfile(ABSPATH . WPINC . "/js/wp-emoji-loader.js");
?>
</script>
<?php
} else {
$settings['source'] = array(
/** This filter is documented in wp-includes/class.wp-scripts.php */
'concatemoji' => apply_filters('script_loader_src', includes_url("js/wp-emoji-release.min.js?{$version}"), 'concatemoji'),
);
/*
* If you're looking at a src version of this file, you'll see an "include"
* statement below. This is used by the `grunt build` process to directly
* include a minified version of wp-emoji-loader.js, instead of using the
* readfile() method from above.
*
* If you're looking at a build version of this file, you'll see a string of
* minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
* and edit wp-emoji-loader.js directly.
*/
?>
<script type="text/javascript">
window._wpemojiSettings = <?php
echo wp_json_encode($settings);
?>;
!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;if(!g||!g.fillText)return!1;switch(g.textBaseline="top",g.font="600 32px Arial",a){case"flag":return g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3;case"diversity":return g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,d=c[0]+","+c[1]+","+c[2]+","+c[3],g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e;case"simple":return g.fillText(h(55357,56835),0,0),0!==g.getImageData(16,16,1,1).data[0];case"unicode8":return g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<?php
}
}