WordPress Version: .10
/**
* Prints inline Emoji dection script
*
* @ignore
* @since 4.6.0
* @access private
*/
function _print_emoji_detection_script()
{
$settings = array(
/**
* Filters the URL where emoji png images are hosted.
*
* @since 4.2.0
*
* @param string The emoji base URL for png images.
*/
'baseUrl' => apply_filters('emoji_url', 'https://s.w.org/images/core/emoji/2.3/72x72/'),
/**
* Filters the extension of the emoji png files.
*
* @since 4.2.0
*
* @param string The emoji extension for png files. Default .png.
*/
'ext' => apply_filters('emoji_ext', '.png'),
/**
* Filters the URL where emoji SVG images are hosted.
*
* @since 4.6.0
*
* @param string The emoji base URL for svg images.
*/
'svgUrl' => apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/2.3/svg/'),
/**
* Filters the extension of the emoji SVG files.
*
* @since 4.6.0
*
* @param string The emoji extension for svg files. Default .svg.
*/
'svgExt' => apply_filters('emoji_svg_ext', '.svg'),
);
$version = 'ver=' . get_bloginfo('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 b,c,d,e,f=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.clearRect(0,0,j.width,j.height),k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(f(55356,56826,55356,56819),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,56826,8203,55356,56819),0,0),c=j.toDataURL(),b!==c&&(k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447),0,0),c=j.toDataURL(),b!==c);case"emoji4":return k.fillText(f(55358,56794,8205,9794,65039),0,0),d=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55358,56794,8203,9794,65039),0,0),e=j.toDataURL(),d!==e}return!1}function e(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d");for(i=Array("flag","emoji4"),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
}
}