Created
October 16, 2014 14:59
-
-
Save joeyz/963bcdd12e84a1f3352d to your computer and use it in GitHub Desktop.
Cleanup WP formatting for shortcodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( !function_exists('wpex_fix_shortcodes') ) { | |
function wpex_fix_shortcodes($content){ | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} | |
add_filter('the_content', 'wpex_fix_shortcodes'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment