Last active
December 18, 2015 13:18
-
-
Save mo3aser/874b0a5bf8bd17a75874 to your computer and use it in GitHub Desktop.
Removing the automatic <p> and <br> WordPress 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 | |
// Removing the automatic <p> and <br> WordPress Shortcodes | |
// By Fouad Badawy | tielabs.com | |
function tie_fix_shortcodes($content){ | |
$array = array ( | |
'[raw]' => '', | |
'[/raw]' => '', | |
'<p>[raw]' => '', | |
'[/raw]</p>' => '', | |
'[/raw]<br />' => '', | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} | |
add_filter('the_content', 'tie_fix_shortcodes'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment