'😄', ':smiley:' => '😃', ':wink:' => '😉', ':blush:' => '😊', ':grin:' => '😁', ':smirk:' => '😏', ':heart_eyes:' => '😍', ':sunglasses:' => '😎', ':laughing:' => '😆', ':joy:' => '😂', ':neutral_face:' => '😐', ':flushed:' => '😳', ':hushed:' => '😮', ':dizzy_face:' => '😵', ':cry:' => '😢', ':persevere:' => '😣', ':worried:' => '😟', ':angry:' => '😠', ':mag:' => '🔍', ':hot_beverage:' => '☕', ':exclamation:' => '❗', ':question:' => '❓' ); // outputs the editor toolbar function plugin_emoticons() { global $plugin_emoticons; if (!count($plugin_emoticons)) return true; echo '
'; foreach ($plugin_emoticons as $text => $emoticon) { echo ''; echo $emoticon; echo ' '; } echo '
'; return true; } // replaces the text with an utf-8 emoticon function plugin_emoticons_filter ($emostring) { global $plugin_emoticons; foreach ($plugin_emoticons as $text => $emoticon) { $emostring = str_replace( $text, // Is better for screen readers '' . $emoticon . '', $emostring ); } return $emostring; } // css file function plugin_emoticons_head() { $pdir = plugin_geturl('emoticons'); echo ' '; } // register emoticon head add_action('wp_head', 'plugin_emoticons_head', 10); // register editor toolbar add_filter('simple_toolbar_form', 'plugin_emoticons',); // register to the hook add_filter('the_content','plugin_emoticons_filter'); // register for emoticon in comment add_filter('comment_text','plugin_emoticons_filter'); // register for the excerpt of a post add_filter('the_excerpt', 'plugin_emoticons_filter'); ?>