Last active
November 1, 2019 11:12
-
-
Save ivo-ivanov/098b93c882635d762061c820677490bd to your computer and use it in GitHub Desktop.
Modify Contact Form 7 output with filter/preg_replace. #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_elements', 'rl_wpcf7_form_elements' ); | |
| function rl_wpcf7_form_elements( $content ) { | |
| // replace element with preg_replace | |
| $rl_pfind = '/<label>/'; | |
| $rl_preplace = '<label class="wpcf7-label">'; | |
| $content = preg_replace( $rl_pfind, $rl_preplace, $content, 2 ); | |
| return $content; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment