-
-
Save billerickson/466081eacadd3a2e6d0ad440e8d56e30 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Limit ConvertKit signup based on checkbox | |
* | |
*/ | |
function ea_wpforms_limit_convertkit_signup( $process, $fields, $form_data ) { | |
// Limit to user registration form | |
if( 20 != $form_data['id'] ) | |
return $process; | |
// Don't process if checkbox is empty | |
if( empty( $fields[5]['value_raw'] ) ) | |
$process = false; | |
return $process; | |
} | |
add_filter( 'be_convertkit_process_form', 'ea_wpforms_limit_convertkit_signup', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment