Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save w3b-beweb/cff807355d5e2c6529159b747a6cd66b to your computer and use it in GitHub Desktop.
Save w3b-beweb/cff807355d5e2c6529159b747a6cd66b to your computer and use it in GitHub Desktop.
Change Mailchimp tag in Elementor Pro forms on submit
<?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