Stop Shortcode from being executed
2014
For some of my Plugins, I use a WordPress page to explain how they work. Of course, on this page, I also activate the plugin to show, what this plugin can do.
But this means some trouble. Once, you want to explain the shortcode and you write the shortcode – well, the shortcode gets executed of course. So sometimes, it would be very useful to stop shortcodes from being executed.
So, I’ve developed another shortcode, which prevents shortcodes to get executed: [stop_shortcode].
How does it work? Lets say, I write an article, in which I explain the usage of a shortcode:
You have to use the plugins shortcode [stop_shortcode][this_shortcode_wont_be_executed][/stop_shortcode]
All you need are these four lines of code:
add_shortcode( 'stop_shortcode', 'stop_shortcode' ); function stop_shortcode( $attr, $content ){ return $content; }
Add them to your functions.php and you are done.