hello,
Always be safe take a copy or make a backup of the the below files before editing.. ??
I to have a problem with such an large overhead especially when it clashes with my current cookie setup of another pre existing plugin.
If those of you who were wondering why this may not seem to work it does.. The first solution is for the shortcode that’s placed in the post or page not the group selector widget.
So if you want this to work with the group selector you need to update the “es-af-register.php” for the group selector plugin directly.
This can be found at about line 400 in the file as listed below.
(wp-content/plugins/email-subscribers-advanced-form/includes/es-af-register.php)
The code is the same as @svenhanstein but you need to change the variable to $es_af
.
You can leave in the GDPR routine in place, just rem out the “get” call for GDPR check box like below for safety sake if you wish to revert if you still have the GDPR plugin active.
example below..
if (( in_array('gdpr/gdpr.php', $active_plugins) || array_key_exists('gdpr/gdpr.php', $active_plugins) )) {
//$es_af .= GDPR::get_consent_checkboxes();
}
Then just below it place this statement as per @svenhanstein suggestion. Note the variable name change.
$es_af .= '<div><input onchange="this.setCustomValidity(validity.valueMissing ? \'I accept the terms and conditions\' : \'\');" id="field_terms" type="checkbox" required name="terms"> <span>I accept the <a href="https://www.link-to-your-privacy-policy" rel="nofollow noopener noreferrer" target="_blank"> terms and conditions</a></span></div>';
I have placed this in all three files to cover off flexibility if I want to use a shortcode elsewhere on our site later.