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
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.
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.
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.
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?
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);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 …
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 :/
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?)
Thanks alot this plugin, it worked great on my site.
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?
PHP stands for “PHP: Hypertext Preprocessor”, not “Hypertext PreProcessing”
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!
Great plugin!
By the way Jeannie:
Check for spaces, newlines or any characters before the , and remove them. That should work.
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.
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.
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”.
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).
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?
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,
$fileis 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.
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”.
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”].
Thanks for it …was looking for a similar plugin !
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!