Macro Expander

Replaces user-defined keywords in a blog post with the output from the corresponding user-defined PHP function.

Author:Matthijs Hollemans (profile at wordpress.org)
WordPress version required:2.0
WordPress version tested:2.2
Plugin version:1.1
Added to WordPress repository:16-08-2007
Last updated:16-08-2007
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:http://www.hollemansproductions.com/wordpress...
Total downloads:1 872
Active installs:40+
plugin download
Click to start download

You invoke a macro by typing a special command in your blog post:

[[keyword]]

Upon reading this command, the PHP function named "macro_keyword" is called and its output is inserted on the page.

You can also pass a parameter to the macro:

[[keyword][param]]

Or multiple parameters:

[[keyword][param1][param2]]

The parameters are separated by the ][ characters, or rather, you can look at it as a list of things in brackets surrounded by another pair of brackets.

The PHP file for this plugin has an example function that shows you how to write macros. It is called "[[test]]" and is defined in the function "macro_test". The "test" macro takes up to two parameters, both optional.

New in 1.1: If you want to include the macros in RSS content, you will have to define a second function named "macro_rss_keyword". If this function is not present, the macro will not be included in the RSS output.