I'm developing a site which leans heavily on emoji for visual interest.

The twemoji emoji set that is loaded by wp-emoji.js is really good visually. And importantly I want all users to get the same visual experience. In this case, even at the expense of performance. Some systems emoji sets are really undesirable.

As far as I can tell, wp-emoji.js ONLY loads twemoji.js when the system doesn't have its own emoji set, or when the emoji set doesn't contain the desired emoji.

How can I switch this so it ALWAYS loads?

I've moving the action that calls the wp-emoji-release.min.js script down to the very bottom of the footer - but that doesn't do the job by itself

remove_action('wp_head', 'print_emoji_detection_script', 7); add_action('wp_footer', 'print_emoji_detection_script', PHP_INT_MAX);

  • Actually running this script kinda does the job window.onload = function(){ document.body = twemoji.parse(document.body) }; So once the page is loaded with the sytem emoji, it goes back and renders them again with the twemoji... Its not ideal answer, but if its doing that sooner it might not override the system emoji?
    – Ruben
    May 6, 2021 at 2:59
  • Now it turns out that this function is breaking the front end Visual Tiny MCE editor (in bbpress), only on Firefox browsers. I have no idea why this is causing a conflict. 🤯
    – Ruben
    Jun 2, 2021 at 4:52
  • So excluding the Tiny MCE editor: ` window.onload = function(){ document.body:not(.mce-content-body) = twemoji.parse(document.body) }; `
    – Ruben
    Jun 2, 2021 at 5:01


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.