Created
August 2, 2011 07:03
-
-
Save bueltge/1119722 to your computer and use it in GitHub Desktop.
Debug Shortcodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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