Make WordPress Core


Ignore:
Timestamp:
03/11/2015 10:48:16 PM (10 years ago)
Author:
pento
Message:

Add emoji support, with Twemoji fallback.

Replace exisiting smilies with equivalent emoji, or with shiny new smiley images where no emoji existed.

Props batmoo, joen and mkaz for the original plugin upon which this is based.

Props pento, iseulde, kraftbj and peterwilsoncc for making the internet's dreams come true.

See #31242

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r31723 r31733  
    425425    $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 );
    426426
     427    $scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), false, 1 );
     428    $scripts->add( 'emoji', "/wp-includes/js/emoji$suffix.js", array( 'twemoji' ), false, 1 );
     429    did_action( 'init' ) && $scripts->localize( 'emoji', 'EmojiSettings', array(
     430        /**
     431         * Filter the URL where emoji images are hosted.
     432         *
     433         * @since 4.2.0
     434         *
     435         * @param string The emoji base URL.
     436         */
     437        'base_url' => apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72/' ),
     438        /**
     439         * Filter the extension of the emoji files.
     440         *
     441         * @since 4.2.0
     442         *
     443         * @param string The emoji extension.
     444         */
     445        'ext'      => apply_filters( 'emoji_ext', '.png' ),
     446    ) );
     447    $scripts->enqueue( 'emoji' );
     448
    427449    if ( is_admin() ) {
    428450        $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.