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 | |
add_filter('frm_success_filter', 'add_the_download_form_button', 1000, 2); | |
function add_the_download_form_button($type, $form) | |
{ | |
// If this is the download form we can now check for a file. | |
if ($form->id == 4 | |
&& isset($_POST)) { | |
$pid = null; |
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
add_filter('gform_pre_render', function($form) | |
{ | |
$user_consent_form = get_field('user_contact_preferences_form', 'option'); | |
if ($user_consent_form) { | |
if ($form['id'] === (int)$user_consent_form) { | |
// This should return an array if its set. | |
$user_consent_marketing = get_user_meta(get_current_user_id(), 'marketing_consent'); | |
if ($user_consent_marketing) { | |
// find out which field is "marketing_consent" |
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
// Replace YOUR_NEW_HOOK_NAME with the correct hook you want to output at, this should be within the form on the checkout still... | |
// I just needed to move mine from the addresss to somewhere else on the checkout. | |
$mailchimp_options = get_option('mailchimp-woocommerce'); | |
if($mailchimp_options && isset($mailchimp_options['mailchimp_checkbox_action'])) { | |
$mailchimp_options['mailchimp_checkbox_action'] = 'YOUR_NEW_HOOK_NAME'; | |
update_option('mailchimp-woocommerce', $mailchimp_options); | |
} |