Skip to content

Instantly share code, notes, and snippets.

@R3V1Z3
Last active August 29, 2015 14:04
Show Gist options
  • Save R3V1Z3/b63c0820b30802035110 to your computer and use it in GitHub Desktop.
Save R3V1Z3/b63c0820b30802035110 to your computer and use it in GitHub Desktop.
Shortcode to easily display unrendered shortcodes in WordPress content. It just wraps the specified shortcode parameter with the shortcode tags like [shortcode].
<?php
// [unrendered shortcode="shortcode"]
function unrendered_function( $atts ) {
$a = shortcode_atts( array(
'shortcode' => 'shortcode'
), $atts );
return '[' . esc_attr($a['shortcode']) . ']';
}
add_shortcode( 'unrendered', 'unrendered_function' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment