Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cleanup WP formatting for shortcodes
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
You can’t perform that action at this time.