I’ve updated my Shortcut Macros plugin to make it WordPress 2.5 compatible.
This plugin allows you to set up shortcuts that expand into longer text when you save a post/page. For example, if you link to my site often, you might create a macro of ak
. You type ##ak
into a post/page and when you save it will expand to <a href="https://alexking.org/">Alex King</a>
.
The download and more information are available on my WordPress Plugins page.
If you have any trouble with this, please open a thread in the WP Support Forums and send me the link.
This post is part of the project: Shortcut Macros. View the project timeline for more context on this post.
[…] Read it at the source […]
Just wondering, why not use the new Shortcode API to do exactly the same thing?
I’m not going to speak for Alex, but I’m guessing there are several reasons:
1. As you noted, the shortcode API is new and is only in WP 2.5. This works on older versions as well.
2. It was already written for older versions, and works, why do a complete re-write of it so that it’s only compatible with 2.5+ when minor changes were all that were needed?
3. The people that use this now are likely used to the macros as they exist, why force them to learn new ones?
That’s just a guess…
Does this save the code in the post and then change it at display time, or does it change the text and save the changed text with the post?
If the latter, that is a _big_ difference between this and shortcodes. I like!
The shortcuts are translated before the post is saved and the resulting output is saved (not the shortcut).