Get subscriber data | WordPress.org

Hi
I use MC4WP with a CF7 form. The form has a second acceptance (checkbox) field.
If the user checks this checkbox I need to also add a specific tag to the subscriber.

Below a code to explain what I need:

add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
    if ($cf7_form_id == 1274) {
        $subscriber->tags[] = 'apple';
        if (subscriber checked that checkbox) { // <== How I get that data?
           // add another specific tag "banana"
        }
    } else if ($cf7_form_id == 510) {
        // etc
    }
    return $subscriber;
}, 10, 2);

Thanks

  • This topic was modified 25 minutes ago by dafsade.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer