Shortcode - adampatterson/Tentacle GitHub Wiki

Set a short code

[short_code string]

Shortcode attributes

[short_code foo="bar" bar="bing"]

Registering a shortcode:

add_shortcode( 'short_code', 'function_name' );

Calling a shortcode

do_shortcode( $content );

Shortcode function

function function_name ( $content ) 
{
   // Do something awesome with ( string )
}

Shortcode functions with attributes

function function_name ( $content ) 
{
   // Do something awesome with array( 'foo' => 'bar', 'bar' => 'bing' )
}

The shortcode library was atapted from WordPress and should function in exactly the same way.