Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created January 10, 2017 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/70f357666ea09efd85b2a36944731baa to your computer and use it in GitHub Desktop.
Save Shelob9/70f357666ea09efd85b2a36944731baa to your computer and use it in GitHub Desktop.
Filters for modifying Converkit sequence ID or Converkit form ID when using Caldera Forms ConvertKit processor to subscribe users to Convertkit on WordPress site. https://calderaforms.com/downloads/convertkit-caldera-forms/
<?php
add_filter( 'cf_convertkit_form_id', function( $ck_form_id, $form ){
//Only act on certain form (update your form ID!)
if( $form[ 'ID' ] == 'cf1234565' ){
//check the value of a field and change ConvertKit field ID if it matched
if( 'Shawn M. Hooper' === Caldera_Forms::get_field_data( 'fld_123456', $form ) ){
$ck_form_id = 42;
}
return $ck_form_id;
}
}, 20, 2);
<?php
add_filter( 'cf_convertkit_sequence_id', function( $ck_sequence_id, $form ){
//Only act on certain form (update your form ID!)
if( $form[ 'ID' ] == 'cf1234565' ){
//check the value of a field and change ConvertKit field ID if it matched
if( 'Roy Sivan' === Caldera_Forms::get_field_data( 'fld_123456', $form ) ){
$ck_sequence_id = 42;
}
}
return $ck_sequence_id;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment