Last active
November 26, 2019 05:20
-
-
Save josecarlospsh/dc7d7d557a10cb7850ffb997c29fa797 to your computer and use it in GitHub Desktop.
Remove span tag from CF7
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 | |
/*Remove <span></span> tag from Contact Form 7*/ | |
add_filter('wpcf7_form_elements', function($content) { | |
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content); | |
$content = str_replace('<br />', '', $content); | |
return $content; | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment