Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created July 24, 2020 16:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dparker1005/13ab3295d92818b3e46c53b0ca0268ba to your computer and use it in GitHub Desktop.
Save dparker1005/13ab3295d92818b3e46c53b0ca0268ba to your computer and use it in GitHub Desktop.
Creates a new merge field in Mailchimp if one doesn't already exist.
<?php
// Copy from below here...
/*
* Creates a new merge field in Mailchimp if one doesn't already exist.
*/
function my_pmpro_mailchimp_merge_fields( $merge_fields ) {
// Adds a "COMPANY" merge field to Mailchimp.
$merge_fields[] = array('name' => 'COMPANY', 'type' => 'text');
return $merge_fields;
}
add_filter( 'pmpro_mailchimp_merge_fields', 'my_pmpro_mailchimp_merge_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment