Hide Broken Shortcodes
- Author:Scott Reilly
- Version:1.1
- Last update:05 Jan 2010
- Compatibility:WP 2.5+, 2.6+, 2.7+, 2.8+, 2.9+
- Comments:go here
- Download:[ zip ]
- Description:
Prevent broken shortcodes from appearing in posts and pages.
-
Extended Description
Prevent broken shortcodes from appearing in posts and pages.
Shortcodes are a handy feature of WordPress allowing for a simple markup-like syntax to be used within post and page content, such that a handler function will replace the shortcode with desired content. For instance, this:
[youtube id="abc" width="200"]
might be replaced by a plugin to embed a YouTube video into the post with a width of 200. Or:
[make_3d]Special News[/make_3d]
might be used to make a three-dimensional image of the text contained in the shortcode tag, ‘Special News’.By default, if the plugin that provides the functionality to handle any given shortcode tag is disabled, or if a shortcode is improperly defined in the content (such as with a typo), then the shortcode in question appears on the blog in its entirety, unprocessed by WordPress. At best this reveals unsightly code-like text to visitors and at worst can potentially expose information not intended for visitor’s eyes.
This plugin prevents unhandled shortcodes from appearing in the content of a post or page. If the shortcode is of the self-closing variety (the first example above), then the shortcode tag and its attributes are not displayed and nothing is shown in their place. If the shortcode is of the enclosing variety (the second example above), then the text that is being enclosed will be shown, but the shortcode tag and attributes that surround the text will not be displayed (e.g. in the second example above, “Special News” will still be displayed on the site).
Find out more at the plugin’s WordPress Plugin Repository page.
Installation
- Unzip
hide-broken-shortcodes.zipinside the/wp-content/plugins/directory for your site (or install via the built-in WordPress plugin installer) - Activate the plugin through the ‘Plugins’ admin menu in WordPress
- Unzip
Release Log
- 05 Jan 2010 : v1.1 — Release Notes. Highlights: adds a filter, ‘hide_broken_shortcode’, to allow customization of the output for broken shortcodes; widget_text is also now filtered by the plugin; note WP 2.9+ compatibility; add code documentation; update copyright date
- 09 Apr 2009 : v1.0 — Initial release
Copyright & Disclaimer
Copyright © 2009-2010 by Scott Reilly (aka coffee2code)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
