Version: 1.6 Prevent broken shortcodes from appearing in posts and pages.
The plugin is further customizable via two filters. Typically, these customizations would be put into your active theme's functions.php file, or used by another plugin.
The 'hide_broken_shortcode' filter allows you to customize what, if anything, gets displayed when a broken shortcode is encountered. Your hooking function can be sent 3 arguments:
Arguments :
Example:
add_filter( 'hide_broken_shortcode', 'hbs_handler', 10, 3 );
function hbs_handler( $default, $shortcode, $content ) {
return ''; // Don't show the shortcode or text bookended by the shortcode
}
The 'hide_broken_shortcodes_filters' filter allows you to customize what filters to hook to find text with potential broken shortcodes. The two default filters are 'the_content' and 'widget_text'. Your hooking function will only be sent one argument: the array of filters.
Example:
add_filter( 'hide_broken_shortcodes_filters', 'hbs_filter' );
function hbs_filter( $filters_array ) {
$filters_array[] = 'the_title'; // Assuming you've activated shortcode support in post titles
return $filters_array;
}
Requires: 2.5 or higher
Compatible up to: 3.5.1
Last Updated: 2012-12-11
Downloads: 2,607
Got something to say? Need help?