Created
April 22, 2013 18:36
-
-
Save benfavre/5437388 to your computer and use it in GitHub Desktop.
Cleanup Shortcode #WordPress #functions.php
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
<?php | |
// A mettre dans functions.php | |
add_filter('the_content', 'clean_p_shortcode'); | |
function clean_p_shortcode($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