Skip to content

Instantly share code, notes, and snippets.

@paulruescher
Created July 5, 2012 05:50
Show Gist options
  • Save paulruescher/3051599 to your computer and use it in GitHub Desktop.
Save paulruescher/3051599 to your computer and use it in GitHub Desktop.
Modify Contact Form 7 Form Output
add_filter( 'wpcf7_form_elements', 'rl_wpcf7_form_elements' );
function rl_wpcf7_form_elements( $content ) {
// global $wpcf7_contact_form;
$rl_pfind = '/<p>/';
$rl_preplace = '<p class="wpcf7-form-text">';
$content = preg_replace( $rl_pfind, $rl_preplace, $content, 2 );
return $content;
}
add_filter( 'wpcf7_form_class_attr', 'rl_wpcf7_form_class_attr' );
function rl_wpcf7_form_class_attr( $content ) {
$rl_formfind = '/wpcf7-form/';
$rl_formreplace = 'wpcf7-form clearfix';
$content = preg_replace( $rl_formfind, $rl_formreplace, $content );
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment