Skip to content

Instantly share code, notes, and snippets.

@bueltge
Created August 2, 2011 07:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bueltge/1119722 to your computer and use it in GitHub Desktop.
Save bueltge/1119722 to your computer and use it in GitHub Desktop.
Debug Shortcodes
function fb_show_shortcodes( $atts, $content = NULL ) {
extract( shortcode_atts(
array('linebreak'=>''),
$atts
) );
$brackets = array();
$brackets[0] = "/\[/";
$brackets[1] = "/\]/";
$replace_with = array();
$replace_with[0] = "[";
$replace_with[1] = "]";
$content = preg_replace( $brackets, $replace_with, trim($content) );
$content .= ( ! empty($linebreak) ) ? "<br />" : "";
return $content;
}
// use ssc as shortcode and display all shortcodes of install
add_shortcode( 'ssc', 'fb_show_shortcodes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment