Last active
June 12, 2024 13:50
-
-
Save w3b-beweb/cff807355d5e2c6529159b747a6cd66b to your computer and use it in GitHub Desktop.
Change Mailchimp tag in Elementor Pro forms on submit
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_action( 'elementor_pro/forms/process', function( $record, $ajax_handler ) { | |
| //make sure its our form | |
| $form_name = $record->get_form_settings( 'form_name' ); | |
| if ( 'Name of the form' !== $form_name ) { | |
| return; | |
| } | |
| //get settings of this form instance | |
| $settings = $record->get('form_settings'); | |
| //change tags | |
| $settings['mailchimp_tags'] = 'what_evere_you_need, as_mailchimp_tag'; | |
| //overwrite settings | |
| $record->set('form_settings', $settings); | |
| }, 10, 2 ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment