Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created February 29, 2016 17:18
Show Gist options
  • Save joshfeck/dc9643ae79bce706198c to your computer and use it in GitHub Desktop.
Save joshfeck/dc9643ae79bce706198c to your computer and use it in GitHub Desktop.
Syncs a specific tag to Infusionsoft based on the current registration status.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EEE_Infusionsoft_Registration__sync_to_infusionsoft__infusionsoft_tags', 'jf_ee_infusionsoft_tag_reg_and_paid', 10, 2 );
function jf_ee_infusionsoft_tag_reg_and_paid( $tags, $registration ) {
if(
$registration instanceof EE_Registration &&
in_array(
$registration->status_ID(),
array(
EEM_Registration::status_id_approved
))) {
//reg is approved, let's tag it paid!
$tags[] = 119; // tag ID for paid, change this to match your account's tag
} else {
$tags[] = 117; // tag ID for registered, change this to match your account's tag
}
return $tags;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment