Created
November 16, 2015 12:01
-
-
Save putrasurya/8e37df9edb764b6274a2 to your computer and use it in GitHub Desktop.
cleaning up wordpress shortcode formatting
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 your_shortcode ($atts, $content) { | |
/** | |
* remove nested p tag that automatically generate by wordpress | |
*/ | |
return preg_replace("/^<\/p>|<p>$/", "", $content); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment