Created
January 19, 2016 18:45
-
-
Save gnikolopoulos/0bfea14434c08c1064e2 to your computer and use it in GitHub Desktop.
[Wordpress] Remove p and br tags from custom 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
<?php | |
if( !function_exists('id_fix_shortcodes') ) { | |
function id_fix_shortcodes($content){ | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} | |
add_filter('the_content', 'id_fix_shortcodes'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment