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.
Any idea if Scotts replacer plugin was based on yours?
Hrm, I seem to have lost all my comments in the proccess of upgrading. That’s odd!
There’s a bug in your plugin: http://wordpress.org/support/10/14053
Well, I hadn’t thought of the case where you used the same acronym twice within an HTML tag (as in the case where you put “W3C” into the image’s ALT tag and TITLE tag). Anyway, the simplest solution is to tweak the second preg_replace statement, and put several copies of it in, so that it matches acronyms inside HTML code more than once. You can see that it works in the picture of my daughter I’ve inserted above.
I’ll try to come up with a better solution later today, but in the meantime I’ve marked the acronym plugin 2.7 and you can download it at the link above.
There. I’ve come up with a new regular expression which is so good, it doesn’t need a second one to go back and remove replacements from inside links. Of course, this means it’s sufficiently different that I’ve probably forgotten something. If you can find any examples that don’t work, please post them here in the comments so I can keep tweaking, and this page can become my litmus test.
Feel free to grab 2.8 from the link above.
Thanks a lot!
I have installed WP 1.3 on a test system this afternoon and your acronym plugin causes many error messages in connection with posting comments and blog entries. I know that WP 1.3 is in development but do you think you will find time to make your great plugin WP 1.3 compatible?
Well … don’t tell anyone, but I’m running nightlies (right now it’s from 2004-9-29, I think) ...
So, yes, and … wait, error messages?
I’m trying to use this but its not working…I’d like to use this more as a provider of definitions. For example:
$acronym_acronym = array(
“missiology” => “missiology is the area of practical theology which studies the mission of the Church including evangelism, apologetics and work of the Christian in their cultural setting”,
Should this still work? It doesn’t seem to…am I doing something wrong?
he nice features of WordPress is its ability to use plugins. A handy plugin is that of the Acronym Replacer. Unfortunately, it is interfering with many of the ed [...]
Hi there, I love this plugin. However, I am having problems with it activated when I try to save posts/update templates:
Warning: Cannot modify header information - headers already sent by (output started at /home/uruloki/public_html/wp-content/plugins/acronyms.php:158) in /home/uruloki/public_html/wp-admin/post.php on line 146The line in post.php where it seizes up is different (between 340 and 146 usually). I am using WP 1.2 with Acronym Replacer 2.8, and was wondering if there was anything else I have to do to install the plugin (I simply used the plugin manager in the CMS).
Thanks for the plugin and the help!
This is usually a copy/paste error: the result of having extra space (usually a blank line or two) at the top (or bottom, in this case) of the plugin file, outside the php tags.
hi there! you’ve made a nice plugin. i’ve enabled wordpress to show excerpts – if the exists. but the acronyms won’t be replaced in them, only in the single post view. how can i fix this?
t0mmy
IMHO, you shouldn’t put code in your excerpts, which is why the acronym plugin’s not enabled on them. If you want to enable it on the excerpt, you just add a line (right below all the other add_filter lines at the bottom):
add_filter('the_excerpt_rss', 'acronyms', 18);30; than some other software, and this is important. Of course, one element of that is my acronym plugin which helps you use semantically correct acronym tags a [...]
CSS. acronym { border-bottom: 1px dotted #000; } If you use wordpress you can use the acronym replacer to automate the process just like Randy Peterman.
[...]
Hmm. I just added your plug-in to my new WP site and it doesn’t “acronymize” anything in the entry title — Check out my site to see what happens.
I have pluged acornyme replacer 2.0 in to my wp 1.2.
After doing so, I get the following massage when I try to login.
Parse error: parse error, unexpected T_LNUMBER in /customers/rjohnsen.dk/rjohnsen.dk/httpd.www/wp-content/plugins/acronyms.php on line 57
And yes I don’t know much about this, so please – spell it out for me.
Thanks – if you decide to di so …
in my posts to links from my WordPress links database. The plugin is an adaptation of the WordPress Acronym Plugin that, rather than wrapping key phrases in an [...]
t step, then this reading should interest you. Notice: this page is using a plugin called Acronym Replacer. This is replacing text, even in the highlighted code [...]
If you’re having login page issues (returning blank), a minor plugin issue could be the cause.
As an explanation, yet another FYI: I, too, somehow stumbled into the trailing spaces issue: a single whitespace had crept into the last line in wp-acronyms.php, just after the closing “?>” tag. Most interestingly, not only was the acronym feature not working, but it broke the WP login page: the base login page came up fine, but after entering my user/pass, I got back a completely blank page — and still wasn’t logged in.
I still don’t know how or exactly when this extra space crept in
[...] placer”> WordPress Plugin – Acronym Replacer Blinks WordPress Plugin – Acronym Replacer – for my own ref. [...]
Fantastic plugin, I’ve just implemented it on my fledgling blog, and I know it will save me a lot of tedious typing – Thanks!
Oh, you probably already know this, I don’t see it mentioned anywhere, but it seems to work fine on WP v1.5.
Hi Joel, great plugin…I saw you were beta testing a more froo-froo laden version that would also let you specify a replacement text for the acronym – i.e., if you were to type :Mom: (I use the colons to distinguish between things I don’t want acronym…ized), it could return [insert replacement text here] as an acronym. Is there a way to hack your current plugin to do this, as you haven’t released the one you were talking about back in October to the masses yet? (Or would you be willing to let the new one out?)
[...] If youa??re feeling adventurous, you can tweak the CSS and make it as pretty as you want. Acronym Replacer Ia??m a huge fan of those little underlines acronyms [...]
[...] 217;t just add, I wrote it too. I based it off a tutorial on writing plugins, mixed in an existing plugin, a viola! My own plugin. I called it Nymania. Wait, w [...]
[...] ct time to create my first WP-plugin, or at least install an existing one. I went over to Michael Heilemann’s web site, and found the acronym plugin. I m [...]
Thanks alot this plugin, it worked great on my site.
[...] se plugins: Weighted Categories, which powers the Technorati-like thing in my archives Acronym Replacer, which doesn’t replace acronyms but inserts acronym t [...]
International Acronyms
Hi to all.
I try to use this plugin in my language Bulgarian.
But the problem is if I put Acronym (for exaple PEPE) in cyrilic nothing happend. In English works good
Some Help?
[...] 9th, 2005 ~ Leonieke Aalders
Current list of plugins running on my website: Huddled Masses: Acronym Replacer skriker: IImage Brows [...]
[...] ood in the fancy tooltips, so I decided to go in and do a quick hack. Also seems like the acronym replacer plugin [...]
[...] it, but it’s kind of a nice feature. I’ve also installed two more plugins: Acronym Replacer, from Joel Bennett adds a predefined acronym tag to [...]
PHP stands for “PHP: Hypertext Preprocessor”, not “Hypertext PreProcessing”
[...] ks properly now. Some plugins are used, too, and in case you’re wondering, they are: Acronym Replacer, My Comments, Custom Post Per Page, Recent Posts and [...]
[...] Let me run down a few simple ideas: Insert a breadcrumb navigation on your page Add an Acronym Replacer so when your write AOL, it looks uber-stylish Turn o [...]
I was experiencing the same problem as a few of you on this site when I would copy off the text from this website and past it into an empty Dreamweaver file. When I would try activating the plugin it would say something like unexpected T_Expression and not work.
The problem was in the white space on each line. Apparently they are a different type of white space then a regular push of the space bar. So I put the code into BBedit lite and set it to display hidden characters and spaces. Then I selected one of the wrong space (it was displayed as a solid dot, not a hollow dot) and did a find replace, replacing the trouble makers with regular dots. Now it seams to be working great.
Also, I should note that I am using a Mac OS box running Tiger.
great plugin! exactly what i’ve been hoping to find. unfortunately, it makes my admin go all wonky. i get the following errors above the rest of the wonky screen:
Warning: Cannot modify header information – headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 10
Warning: Cannot modify header information – headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 11
Warning: Cannot modify header information – headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 12
Warning: Cannot modify header information – headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 13
i’m not php-savvy so it might be a simple fix. i just don’t know what it is. commenting out those lines in the admin.php file didn’t do me any good LOL. any chance for some help?
joel rocks! thanks for the great plug-in!
I get the same errors in my admin as Jeannie did. What should I do to fix it?
Otherwise, it’s a great plugin.
Thanks!
[...] or everyone who posts here. To get your own Gravatar to be displayed, go to gravatar.com. Acronym replacer Simple. Adds acronym tags to all acronyms. What more [...]
Great plugin!
By the way Jeannie:
Check for spaces, newlines or any characters before the , and remove them. That should work.
[...] a??i??a??a??a?? planet of the penguins a?Sa??a??c??a?? Chris Lynch aY?a?Z Joel Bennett cs? Acronym Plugin a??cs? Auto-Link Plugini??a??a?S Greg Hurrell a?? Chris [...]
For those that were getting the errors, I got them too, I had a extra char (CR I think) after the closing ?> Make sure that there is nothing (no space, line break, etc) after the ?> and it should fix it.
I have strictly no space or CR or anything outside my php open/close tags, yet I still get 4 “couldn’t modify headers” errors. Quite annoying. Does this have to do with the file encoding? I’m in UTF-8 to match my WP install.
Wait: I changed encoding to Western ISO-1 (8859-1) and now it seems fine.
Frankly, would getting a direct link to the plugin file be too much to ask for? That encoding bug would vanish.
[...] One of the really useful WordPress plugins I forget about is Acronym Replacer Plugin. It puts an underlined “link” on a wide variety of acronyms like HTML, XML, MSIE, and AOL. When the user moves their mouse over the acronym, a small balloon pops up explaining what these abbreviations mean. You can easily add your own following the format provided by the author. [...]
I’ve finally gotten around to adding a “download” link to my source script. All of my plugins should be simple and easy to download now, just click through to the source and hit the download link.
[...] So here’s what I’ve done so far: I’ve routed my feeds through Feedburner, I’ve claimed the blog on Technorati, I’ve added Talkr podcasting to the posts (see post footers), I’ve gotten rid of the “www” prefix from my address (thanks for the heads up Mathias), I’ve installed a few WordPress plugins that’ll make my life easier such as: IImage Browser, the Huddled Masses Acronym Replacer and the Coldforged Spelling Checker and I’ve imported a few of my posts from passable and the simple web. [...]
[...] Acronym Replacer [...]
Thank you for that plugin. It’s nice to get acronyms without writing them manually. But there is a part which doesn’t behave well at least for the german language. When I’m using “im” within a post it will be replaced with the acronym. Which shouldn’t be done. In my opinion only big letters should trigger a replacement. I tried one of the other regex within your plugin, but I always get following error: “Parse error: parse error, unexpected $ in path/plugins/acronyms.php on line 174”.