Skip to content

testing acronyms

Just checking to make sure that my acronym replacer doesn’t do stupid things like replacing acronyms in URL’s, you know, like here: [;-)] a link with php, irc, html and css all in the link yay, it works, and WP still remains standing!

Incidentally, if you want the hack for your copy of WordPress … just grab it here and copy these lines into your my-hacks.php:

   // And this is for acronym replacement, it's kind-of cool
   include_once('wp-includes/acronyms.php');
   add_filter('the_content', 'acronyms');
   add_filter('comment_text', 'acronyms');
 

One Comment

  1. Your Acronym Replacer is nice. We know using the script a bit modified in our content management system (WebsoziCMS, GPL licensed).

    The modifications are:

    • excluding text with stristr($text, ‘< script') or stristr($text, '< option') or stristr($text, '< input') or stristr($text, '< textarea') or stristr($text, '< object')
    • Better performance by checking the abbreviations before replacing with if(strstr($text, $acronym)) { (after foreach()).

    I`m still searching for a way to use abbreviations with points and white-spaces. Any idea?

    Saturday, March 26, 2005 at 12:10 pm | Permalink