Last active
November 1, 2019 11:08
-
-
Save ivo-ivanov/6c7dcf391288b1949788d30a5dad5619 to your computer and use it in GitHub Desktop.
Add class to Contact Form 7 with filter. #wordpress #wpcf7
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
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 customClass'; | |
$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