postheadericon WordPress Plugin – Acronym Replacer

Acronym Replacer 2.0 wraps common acronyms with the acronym tag and a description. It’s pretty simple, just edit the list of acronyms to add your own, and put it in your plugins directory.

For example:

AOL => America Online,
API => Application Programming Interface,
CD => Compact Disk,

and when you later use “AOL” it will become: <acronym title="America Online">AOL</acronym> (as you can clearly see [ :-) ])

Note: This is a plugin for WordPress 1.2 and up. Get it here

Edit: May 12, 2004

Version 2.4 is now more aggressive at replacing acronyms. However, it no longer replaces acronyms inside of HTML tags, so it should be safe to create links with defined acronyms in the link or it’s title, without breaking anything, like this: The W3C Standards Organization.

As an additional feature, there is a line in the plugin (near the bottom) which, if uncommented, will allow you to stop acronyms from being replaced by surrounding them with dollar signs ($) which will be removed in processing. I’ve disabled that option myself, since it sems like extra work to me, but if you uncomment it, something like this: “$AOL$” would end up as just plain “AOL” but without the acronym tags.

Edit: June 30, 2004

I just released another version which optimizes things by not re-defining the list each time the plugin is invoked. This should save you a ton of lines of code as you define more acronyms. The new version also includes another fix: to allow acronyms to work on the first word.

Edit: May 5, 2006

Happy cinco de Mayo. I’ve released ubernyms now, so if you’re looking for the best acronym replacer around, that’s the one you want, not this one.

116 Responses to “WordPress Plugin – Acronym Replacer”

  • I’m not sure about the error, because I don’t know how you edited the file… but to make the acronyms case sensitive, all you have to do is remove the “i” from the regular expression (that is: replace |imsU with |msU).

  • WP – Abbreviation Replacer (Plugin)

    Die Auszeichung von Texten im Web stellt oft einen groAYen Aufwand an den Autor einer Website oder eines Artikels im Netz dar und wird ebenso oft falsch gemacht, wie man hier bei einem Artikel von Labuschin Webdesign nachlesen kann. Um das ganze ein we…

  • kiroro:

    Hello! I come from Taiwan,and just downloaded this plug-in.
    It’s convienient to make me use some abbrev without explain what it is.
    But I have a problem now,that this plug-in seem not to work on Chinese(Big5).
    For Example,
    “(Chinese)”=>“12345”,
    “FF”=>”(Chinese)”,
    the latter works,but former doesn’t.
    I guess it’s because the plug-in can’t catch Chinese characters correctly,which consists of two bytes.
    Can you help me fix this problem?

  • [...] Huddled Masses A? Blog Archive A? WordPress Plugin – Acronym Replacer [...]

  • Dave:

    You mentioned your “view source” plugin in one of the comments on this post. I downloaded it from your site and tried it on my own, but I’m having big problems. It gives me errors of undefined variables (DOCUMENT_ROOT, PHP_SELF, and file). The first two can be fixed by changing “dirname($DOCUMENT_ROOT.$PHP_SELF)” to “$_SERVER[‘DOCUMENT_ROOT’]” and “$PHP_SELF” to “$_SERVER[‘PHP_SELF’]”. I’m assuming that’s an issue with the PHP version. But what about the “file” variable? Any ideas?

  • Yeah! Actually, it’s not just the version, it’s the register_globals being off. For some reason, I had mine on… hopefully i haven’t broken anything by turning it off.

    Anyway, $file is the parameter that you need to pass to the script, like to view the source.php script, you need a link to source.php?file=source.php or else you should just get the “sorry, that file doesn’t exist” error.

    Anyway, I think I fixed my copy of View Source, so you can use that link I just posted to view it, and even download it.

  • Dave:

    Cool. The new version got past the previous PHP errors, but I’m still getting an error that says “Undefined variable: file in … on line 53”. I hate to be the idiot who doesn’t know how to use PHP, but how do I get PHP (or maybe Apache) to know that $file is the parameter that’s passed in the URL? As in “source.php?file=$file”.

  • [...] Acronym Replacer disables all the other plugins, but if you re-enable them all then it works. Added to codex [...]

  • Dave:

    As a follow-up to my previous comment, I think I answered my own question. The way to get PHP to recognize a variable passed as a parameter in the URL is with the GET function. $file = $_GET[“file”].

  • Dell:

    Thanks for it …was looking for a similar plugin ! :)

  • [...] I upgraded my source viewing script. The original one was an adaptation of a script from Corz. The new one incorporates some information from SitePoint and Huddled Masses by including line numbers and a download link. The mouseover highlighting was my little trick. You can view its source here. Sun, 29 Jan 2006 @ 23:11:23 in Updates Leave a comment Name: [...]

  • Recommended WordPress Plugins…

    Since I started blogging several months have passed now, and I’ve gathered some certain experience with the different plugins for wordpress that are available throughout the net. Some are updated regularly, some aren’t, but all of them that…

  • Acronym Replacer…

    Since some of my readers do not come from the medical realm, I have installed an Acronym Replacer to spell out those cryptic little words. In other words, I got tired of writing everything out.
    If you have any suggestions for acronyms which I use t…

  • [...] Acronym Replacer: Busca los acrA?nimos que hayamos definido y los rodea con etiquetas acronym con su descripciA?n. Es un script muy simple en el que tendremos que editar la lista de acrA?nimos directamente en el archivo PHP. Un sustituto mA?s cA?modo es a??Remplazador de AcrA?nimosa?? de NicolA?s Fantino. [...]

  • [...] Add an Acronym Replacer so when your write AOL, it looks uber-stylish [...]

  • Robert:

    The page layout design on this website needs to be fixed. It chops off all of the comments so they can’t be read. Btw, in terms of legibility, the ideal line length is 12-17 words… not 30-40!

Archives