Forked from dparker1005/pmpro_mailchimp_merge_fields.php
Last active
August 21, 2024 19:14
-
-
Save kimwhite/0e32b7b322093c7a864947375a65c3be to your computer and use it in GitHub Desktop.
Creates a new merge field in Mailchimp if one doesn't already exist.
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 Zip to Mailchimp | |
// 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'); | |
'MERGE10' => ( isset( $_REQUEST['bzipcode'] ) ) ? sanitize_text_field( $_REQUEST['bzipcode'] ) : get_user_meta( $user->ID, 'bzipcode', true ), | |
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