Skip to content

Instantly share code, notes, and snippets.

@kharakhordindemo
Created December 22, 2017 15:21
Show Gist options
  • Save kharakhordindemo/fe0af52a063a9f24c813fcdb202870b8 to your computer and use it in GitHub Desktop.
Save kharakhordindemo/fe0af52a063a9f24c813fcdb202870b8 to your computer and use it in GitHub Desktop.
Remove span in Contact Form 7
/*Contact form 7 remove span*/
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