Last active
October 20, 2021 07:24
-
-
Save ko31/6da92499cb783b12d9ad1e4907cf39ca to your computer and use it in GitHub Desktop.
How to replace the input values of a checkbox to the email body with a line break in Contact Form 7.
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_mail_tag_replaced', function ( $replaced, $submitted, $html, $mail_tag ) { | |
// In this case, the value of "options" tag will be replaced. | |
if ( 'options' === $mail_tag->field_name() ) { | |
$replaced = implode( "\n", $submitted ); | |
} | |
return $replaced; | |
}, 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment