Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wpflippercode/97ea3c89de11d2e3ba72e36c6e1c0de0 to your computer and use it in GitHub Desktop.
Save wpflippercode/97ea3c89de11d2e3ba72e36c6e1c0de0 to your computer and use it in GitHub Desktop.
Verify Cookies Consent Before Showing the Google Maps
add_filter('wpgmp_accept_cookies','wpgmp_accept_cookies');
function wpgmp_accept_cookies($is_allowed) {
// cookies-notice plugin integration -
if( function_exists('cn_cookies_accepted') ) {
$is_allowed = cn_cookies_accepted();
}
// cookies-consent plugin integration. You may change cookie name here according to your needs.
if( $_COOKIE['catAccCookies'] == 1 )
{
$is_allowed = true;
}
return $is_allowed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment