Normalerweise blockiert das Plugin Borlabs Cookie Google Maps und damit verbunden auch die Google Fonts von selbst sofern es via iFrame eingebunden ist. Verwendest du die Google Maps API um deine Google Map einzubinden kannst du den Status des default Cookies folgendermaßen überprüfen:
function get_gmap_cookie_status() {
if ( isset( $_COOKIE['borlabs-cookie'] ) ) {
if ( '' !== trim( $_COOKIE['borlabs-cookie'] ) ) {
$borlabsCookies = $_COOKIE['borlabs-cookie'];
$borlabsCookies = urldecode($borlabsCookies);
$borlabsCookies = stripslashes($borlabsCookies);
$borlabsCookies = json_decode( $borlabsCookies, true );
$consents = $borlabsCookies['consents']['external-media'];
if ( in_array( 'googlemaps', $consents ) ) {
return true;
}
}
}
return false;
}
Du kannst nun mit if ( true === get_gmap_cookie_status() ) {
…deinen Code ausführen.
Stelle noch sicher das du Borlabs Neuladen erzwingst nach der Cookiebestätigung.