The Execution of All Things

If you’re still modifying or hacking up Templates in order to embed custom wordpress functionality inside posts and pages you are way behind the times. Introducing the Execution of All Things plugin (wp-exec). This plugin for WordPress allows users to easily insert dynamic content insides posts or pages (and even include posts or pages within one another!) There is an entire slew of functionality already implemented but, best of all, it supports calling any wordpress function and embedding the output inside a post or page effortlessly.

Okay, so it sounds pretty cool in theory but what does that mean and what tags are currently implemented?

Samples and Examples

Please note that each function is only shown with one or two parameters at most. You should check out the projects page for a complete list of all parameters that can be used.

Date: This is a very simple example but you can easily embed the current date or time in any post or page.

<exec type="date" />

Saturday October 11, 2008 at 8:49 am

<exec type="date" format="m:d:Y g:ia" />

10:11:2008 8:49am

Archives: This is probably the most common usage I found. Instead of faking the templates in order to include a list of archives using the <?php wp_get_archives(); ?> function — you can simply create a new page and embed:

<exec type="archives" />

<exec type="archives" mode="daily" limit="7" />

<exec type="archives" mode="monthly" count="true" />

Categories: Again another common usage would be listing all categories in a post or page.

<exec type="categories" />

Function: This tag will allow you to arbitrarily call any user defined functions (including any wordpress functions and even functions in activated plugins). Tres cool!

<exec type="function" name="pluginsUsedAsTable" />

<exec type="function" name="get_archives" params="postbypost, 20, html" />

Include: This, I think, is the neatest feature of this plugin. It facilitates dynamically including a post or page within one another. You can embed a post inside another post or vice-versa. You simply need to supply the tag the ID number of the post or page you are attempting to include. You can also embed other information by using the field tag (but by default the content is used).

<exec type="include" id="#" />

<exec type="include" id="#" field="excerpt" />

bloginfo: This tag simply gives you quick access to the global information regarding your wordpress installation.

<exec type="bloginfo" show="version" />

2.6.2

Finally, please note that archives and categories just like their PHP counterparts should be encapsulated by <ul> or <ol> in order to be displayed properly.

More Information

You can find more infromation and download this WordPress plugin (wp-exec) from http://www.navidazimi.com/projects/wp-exec/.

Enjoy!

Adieu. Navid.


About this entry