• How are emoji displayed in WordPress? With 6.1.1 I can view source and see emoji being loaded from https://s.w.org. With 6.2 this isn’t happening. To help me troubleshoot, what’s the normal behavior?

    The reason this is important for me is I have CSS targeting emoji which I could do with 6.1.1 but cannot do with 6.2.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Same issue.

    How are emoji displayed in WordPress?

    Emojis are displayed by the current browser (depending on the device/OS). WordPress has some JS that checks if the browser supports all emojis and if not, they are replaced with images. That replacement only happens when the browser doesn’t have full support for emojis.

    The JS test for emoji support was not working properly in WP 6.1 and was fixed in 6.2. So if you’re using a modern browser on a device with modern OS, the emojis may not need to be replaced with images.

    I have CSS targeting emoji…

    May need to update the CSS for when emojis are displayed as (normal) characters by the browser.

    • This reply was modified 1 year, 7 months ago by Andrew Ozz.
    • This reply was modified 1 year, 7 months ago by Andrew Ozz.

    @azaozz In order to achieve a consistent display effect, what should I do if I need to force all emojis to be replaced with pictures? The replacement code that was working fine in WordPress 6.1 no longer works, what should I do?

    The code I’m using:

    function change_wp_emoji_baseurl($url) {
    return set_url_scheme('//cdn.staticfile.org/twemoji/14.0.2/72x72/');
    }
    add_filter( 'emoji_url', 'change_wp_emoji_baseurl' );
    
    function change_wp_emoji_svgurl($url) {
    return set_url_scheme('//cdn.staticfile.org/twemoji/14.0.2/svg/');
    }
    add_filter( 'emoji_svg_url', 'change_wp_emoji_svgurl' );

    Still can’t solve this problem, can someone help me

    Use the following modified “wp-emoji-loader.min.js”. That should fix the problem. The current script breaks emojis in Internet Explorer 11 also. Whoever is making these changes should check them thoroughly before publishing them so as not to break things. Should have multiple browsers and operating systems installed is what I am saying. Even if the browsers or operating systems are no longer being supported by the developers.

    /*! This file is auto-generated */
    !function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){p.clearRect(0,0,i.width,i.height),p.fillText(e,0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(t,0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(p&&p.fillText)switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s("\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!s("\ud83c\uddfa\ud83c\uddf3","\ud83c\uddfa\u200b\ud83c\uddf3")&&!s("\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!s("\u1faf1\u1f3fb\u200d\u1faf2\u1f3ff","\u1faf1\u1f3fb\u200b\u1faf2\u1f3ff")}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(e=t.source||{}).concatemoji?c(e.concatemoji):e.wpemoji&&e.twemoji&&(c(e.twemoji),c(e.wpemoji)))}(window,document,window._wpemojiSettings);

    @-anindya- Thank you very much. it‘s works again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Emoji and 6.2’ is closed to new replies.