====== Emoticons ====== 'smile.gif', // of course format can be whatever; I use PNGs ':(' => 'sad.gif', // these are the images you have in fp-content/emoticons/ ':-)' => 'smile.gif', // you can put multiple shortcuts for the same // etc etc ); $ed = EMOTICONS_DIR; foreach ($EMOTICONS as $emo => $img) { $string = str_replace( " $emo ", /* replace one of the codes defined above, when *sourrounded by spaces* */ "\"{$emo}\"", /* with the tag .emoticon class can be styled as you prefer in your css */ $string ); } return $string; } /* and now, don't forget to register to the hook */ add_filter( 'the_content', 'plugin_emoticons_filter' ); /* if you want it in comments too */ add_filter( 'comment_text', 'plugin_emoticons_filter' ); ?>