Categories
Code Snippets WordPress

How To Use Emoji One On Your Site

Emoji One, an open-source emoji set, revealed their 2016 collection last month and it is beautiful!

WordPress natively uses Twiemoji, a “competing” set sponsored by Twitter when the browser can not display emoji, so how do you switch which is used?

The quick answer is to add this to a core functionality plugin or your theme’s functions.php:


add_filter( 'emoji_url', 'bk_replace_emoji' );

function bk_replace_emoji() {
return 'https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.0/assets/png/';
}

This utilizes a CloudFlare-sponsored CDN to serve the emoji images. Alternatively, you can download the PNG images from the Emoji One developers page, upload them to your own site, and use that URL instead.

In this case, we still rely on WordPress’ emoji-replacing JavaScript, so you’d still miss out on some Unicode 8 and diversity emoji on WordPress 4.4 (added in about-to-ship 4.4.1), but it is an easy, low-maintenance way to use a different icon set.

By Brandon Kraft

My life is an open-source book.

Leave a Reply

Your email address will not be published. Required fields are marked *