Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save greenhornet79/a76e25bffd4f16ef3f5ea8082801bee4 to your computer and use it in GitHub Desktop.
Save greenhornet79/a76e25bffd4f16ef3f5ea8082801bee4 to your computer and use it in GitHub Desktop.
<?php
add_action('leaky_paywall_active_campaign_after_new_subscriber', 'zeen_add_custom_field_for_active_campaign', 10, 2 );
function zeen_add_custom_field_for_active_campaign( $user_id, $contact_id ) {
$field_id = 1; // retrieved from the admin settings custom fields table
$value = sanitize_text_field( $_POST['2_field_8_1'] ); // custom registration field name
$api = new Leaky_Paywall_Active_Campaign_Api();
$api->add_custom_field($contact_id, $field_id, $value);
// add additional custom fields here using the same process
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment