';
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');
?>