Categories
Package/plugin/module WordPress

Hide Broken Shortcodes v1.2

I’d like to announce the official release of the updated Hide Broken Shortcodes plugin (v1.2) for WordPress.

Prevent broken shortcodes from appearing in posts and pages.

Minor update. Highlights: added hooks for customization; renamed class; re-prioritized hook to avoid conflict with other plugins; verified WP 3.0 compatibility.

For more details, instructions, and the download link, visit the plugin’s official homepage at :
coffee2code.com/wp-plugins/hide-broken-shortcodes/.

Comments welcome on this post for this version of the plugin. Comments will be closed once this release has been superseded by another.

Read more for a detailed ChangeLog of the release.

Detailed ChangeLog

These are the detailed changes, which may or may not make sense to you depending on your familiarity with the previous features and internals of the plugin.

  • Allow customization of the filters the plugin applies to via the ‘hide_broken_shortcodes_filters’ filter
  • Change do_shortcode filter priority from 12 to 1001 (to avoid incompatibility with Preserve Code Formatting, and maybe others)
  • Move registering filters into register_filters()
  • Rename class from ‘HideBrokenShortcodes’ to ‘c2c_HideBrokenShortcodes’
  • Store plugin instance in global variable, $c2c_hide_broken_shortcodes, to allow for external manipulation
  • Note compatibility with WP 3.0+
  • Minor code reformatting (spacing)
  • Add Filters and Upgrade Notice sections to readme.txt
  • Remove all header documentation and instructions from plugin file (all that and more are in readme.txt)
  • Remove trailing whitespace from header docs

2 replies on “Hide Broken Shortcodes v1.2”

Hi Scott,

I have a question about the Hide Broken Shortcodes plugin.
Before the question, I really appreciate your awesome plugin and I posted about your plugin in my blog 🙂

My question is how to disable your plugin only for sample shortcodes which I want to display in my blogs. I am using syntaxhighlighter plugin for sample codes in my blogs. ex) let me say [WPP] shortcode is working and I want to just display [WPP] shortcode itself by syntaxhighlighter in my blog.

Thanks,
David.

Hi David,

Apologies for a quite delayed response. Here’s how you’d do it (add the code to your theme’s functions.php file or look into putting it into a site-specific plugin):


function allowed_broken_shortcodes( $display, $shortcode_name, $m ) {
  $shortcodes_not_to_hide = array( 'WPP', 'gallery' );
  if ( in_array( $shortcode_name, $shortcodes_not_to_hide ) )
    $default_display = $m[0];
  return $default_display;
}
add_filter( 'hide_broken_shortcode', 'allowed_broken_shortcodes', 10, 3 );

Comments are closed.