remove_all_shortcodes() WordPress Function
If you're ever working with shortcodes in WordPress and want to remove them all at once, the remove_all_shortcodes() function is your friend. This function will strip out all shortcodes from your content, leaving behind only the content that is not wrapped in a shortcode.
remove_all_shortcodes() #
Clear all shortcodes.
Description
This function is simple, it clears all of the shortcode tags by replacing the shortcodes global by a empty array. This is actually a very efficient method for removing all shortcodes.
Source
File: wp-includes/shortcodes.php
function remove_all_shortcodes() {
global $shortcode_tags;
$shortcode_tags = array();
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |