Aleš Sýkora / April 15, 2021 / 0 comments

Change GDPR field response data in Fluent Forms

Post summary: If you want to change the “Accepted” to something else, use the first snippet and change the $response variable. If you want to change the Terms and Condition and GDPR field response, use this code:

If you want to change the “Accepted” to something else, use the first snippet and change the $response variable.

//Change only GDPR response data
add_filter('fluentform_response_render_gdpr_agreement','gdprText',20,4);
function gdprText($response, $field, $form_id, $isLabel){
    if($form_id=36){
        $response = 'True';
        return $response;
    }
    return;
}

If you want to change the Terms and Condition and GDPR field response, use this code:

//Change both GDPR & Terms and Condition Response data 
$types = [
    'gdpr_agreement',
    'terms_and_condition',
];
foreach($types as $type){
    add_filter('fluentform_response_render_'.$type,'changeGdprText',20,4);
}
function changeGdprText($response, $field, $form_id, $isLabel){
    if($form_id=36){
        $response = 'True';
        return $response;
    }
    return;
}

Fuel my passion for writing with a beer🍺

Your support not only makes me drunk but also greatly motivates me to continue creating content that helps. Cheers to more discoveries and shared success. 🍻

0 comments

Share Your Thoughts