Created
April 6, 2012 10:30
-
-
Save BronsonQuick/2318714 to your computer and use it in GitHub Desktop.
Fix empty paragraphs around shortcodes
This file contains hidden or 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
<?php add_filter('the_content', 'shortcode_empty_paragraph_fix'); | |
// Shortcodes | |
function shortcode_empty_paragraph_fix($content) | |
{ | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment