Created
March 17, 2012 12:48
-
-
Save maxxscho/2058547 to your computer and use it in GitHub Desktop.
Wordpress: Shortcode Empty Paragraph fix
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
function shortcode_empty_paragraph_fix($content) | |
{ | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} | |
add_filter('the_content', 'shortcode_empty_paragraph_fix'); |
After 6 hours and 7 beers i came across this code. You saved my night. Cheers mate.
Holy shit this is a life saver.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's a great solution, thanks!