Make WordPress Core


Ignore:
Timestamp:
03/11/2015 10:48:16 PM (11 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/functions.php

    r31590 r31733  
    29462946    if ( !isset( $wpsmiliestrans ) ) {
    29472947        $wpsmiliestrans = array(
    2948         ':mrgreen:' => 'icon_mrgreen.gif',
    2949         ':neutral:' => 'icon_neutral.gif',
    2950         ':twisted:' => 'icon_twisted.gif',
    2951           ':arrow:' => 'icon_arrow.gif',
    2952           ':shock:' => 'icon_eek.gif',
    2953           ':smile:' => 'icon_smile.gif',
    2954             ':???:' => 'icon_confused.gif',
    2955            ':cool:' => 'icon_cool.gif',
    2956            ':evil:' => 'icon_evil.gif',
    2957            ':grin:' => 'icon_biggrin.gif',
    2958            ':idea:' => 'icon_idea.gif',
    2959            ':oops:' => 'icon_redface.gif',
    2960            ':razz:' => 'icon_razz.gif',
    2961            ':roll:' => 'icon_rolleyes.gif',
    2962            ':wink:' => 'icon_wink.gif',
    2963             ':cry:' => 'icon_cry.gif',
    2964             ':eek:' => 'icon_surprised.gif',
    2965             ':lol:' => 'icon_lol.gif',
    2966             ':mad:' => 'icon_mad.gif',
    2967             ':sad:' => 'icon_sad.gif',
    2968               '8-)' => 'icon_cool.gif',
    2969               '8-O' => 'icon_eek.gif',
    2970               ':-(' => 'icon_sad.gif',
    2971               ':-)' => 'icon_smile.gif',
    2972               ':-?' => 'icon_confused.gif',
    2973               ':-D' => 'icon_biggrin.gif',
    2974               ':-P' => 'icon_razz.gif',
    2975               ':-o' => 'icon_surprised.gif',
    2976               ':-x' => 'icon_mad.gif',
    2977               ':-|' => 'icon_neutral.gif',
    2978               ';-)' => 'icon_wink.gif',
     2948        ':mrgreen:' => 'mrgreen.png',
     2949        ':neutral:' => "\xf0\x9f\x98\x90",
     2950        ':twisted:' => "\xf0\x9f\x98\x88",
     2951          ':arrow:' => "\xe2\x9e\xa1",
     2952          ':shock:' => "\xf0\x9f\x98\xaf",
     2953          ':smile:' => 'simple-smile.png',
     2954            ':???:' => "\xf0\x9f\x98\xaf",
     2955           ':cool:' => "\xf0\x9f\x98\x8e",
     2956           ':evil:' => "\xf0\x9f\x91\xbf",
     2957           ':grin:' => "\xf0\x9f\x98\x84",
     2958           ':idea:' => "\xf0\x9f\x92\xa1",
     2959           ':oops:' => "\xf0\x9f\x98\xb3",
     2960           ':razz:' => "\xf0\x9f\x98\x9b",
     2961           ':roll:' => 'rolleyes.png',
     2962           ':wink:' => "\xf0\x9f\x98\x89",
     2963            ':cry:' => "\xf0\x9f\x98\xa5",
     2964            ':eek:' => "\xf0\x9f\x98\xaf",
     2965            ':lol:' => "\xf0\x9f\x98\x84",
     2966            ':mad:' => "\xf0\x9f\x98\xa1",
     2967            ':sad:' => "\xf0\x9f\x98\xa6",
     2968              '8-)' => "\xf0\x9f\x98\x8e",
     2969              '8-O' => "\xf0\x9f\x98\xaf",
     2970              ':-(' => "\xf0\x9f\x98\xa6",
     2971              ':-)' => 'simple-smile.png',
     2972              ':-?' => "\xf0\x9f\x98\xaf",
     2973              ':-D' => "\xf0\x9f\x98\x84",
     2974              ':-P' => "\xf0\x9f\x98\x9b",
     2975              ':-o' => "\xf0\x9f\x98\xaf",
     2976              ':-x' => "\xf0\x9f\x98\xa1",
     2977              ':-|' => "\xf0\x9f\x98\x90",
     2978              ';-)' => "\xf0\x9f\x98\x89",
    29792979        // This one transformation breaks regular text with frequency.
    2980         //     '8)' => 'icon_cool.gif',
    2981                '8O' => 'icon_eek.gif',
    2982                ':(' => 'icon_sad.gif',
    2983                ':)' => 'icon_smile.gif',
    2984                ':?' => 'icon_confused.gif',
    2985                ':D' => 'icon_biggrin.gif',
    2986                ':P' => 'icon_razz.gif',
    2987                ':o' => 'icon_surprised.gif',
    2988                ':x' => 'icon_mad.gif',
    2989                ':|' => 'icon_neutral.gif',
    2990                ';)' => 'icon_wink.gif',
    2991               ':!:' => 'icon_exclaim.gif',
    2992               ':?:' => 'icon_question.gif',
     2980        //     '8)' => "\xf0\x9f\x98\x8e",
     2981               '8O' => "\xf0\x9f\x98\xaf",
     2982               ':(' => "\xf0\x9f\x98\xa6",
     2983               ':)' => 'simple-smile.png',
     2984               ':?' => "\xf0\x9f\x98\xaf",
     2985               ':D' => "\xf0\x9f\x98\x84",
     2986               ':P' => "\xf0\x9f\x98\x9b",
     2987               ':o' => "\xf0\x9f\x98\xaf",
     2988               ':x' => "\xf0\x9f\x98\xa1",
     2989               ':|' => "\xf0\x9f\x98\x90",
     2990               ';)' => "\xf0\x9f\x98\x89",
     2991              ':!:' => "\xe2\x9d\x97",
     2992              ':?:' => "\xe2\x9d\x93",
    29932993        );
    29942994    }
Note: See TracChangeset for help on using the changeset viewer.