Last active
March 22, 2024 16:41
-
-
Save snrjosh/8a7706459571685e08316ec873244325 to your computer and use it in GitHub Desktop.
Exclude individual fields from WPForms {all_fields} smart tag in notification email
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
<?php | |
add_filter( 'wpforms_entry_email_data', function ( $fields, $entry, $form_data ) { | |
// Bail early if form ID is not equal to 123 | |
if ( $form_data['id'] !== 123 ) { | |
return $fields; | |
} | |
// Unset field from notifications with field ID #2 | |
unset( $fields[2] ); | |
return $fields; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment