Version: 1.6 Prevent broken shortcodes from appearing in posts and pages.
If you want want a shortcode to appear as-is in a post (for example, you are trying to provide an example of how to use a shortcode), can use the shortcode escaping syntax, which is built into WordPress, by using two opening brackets to start the shortcode, and two closing brackets to close the shortcode:
[[some_shortcode]][[an_example style="yes"]some text[/an_example]]The shortcodes will appear in your post (but without the double brackets).
Assuming you want to allow the broken shortcodes 'abc' and 'gallery' to be ignored by this plugin (and therefore not hidden if broken), you include the following in your theme's functions.php file or in a site-specific plugin:
function allowed_broken_shortcodes( $display, $shortcode_name, $m ) {
$shortcodes_not_to_hide = array( 'abc', 'gallery' );
if ( in_array( $shortcode_name, $shortcodes_not_to_hide ) )
$display = $m[0];
return $display;
}
add_filter( 'hide_broken_shortcode', 'allowed_broken_shortcodes', 10, 3 );
Requires: 2.5 or higher
Compatible up to: 3.5.1
Last Updated: 2012-12-11
Downloads: 2,606
Got something to say? Need help?