handling anchor for google-map block

This commit is contained in:
Antoine M 2023-11-24 17:59:23 +01:00
parent 9a354713c2
commit 45f02d4758
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,9 @@
"foreground": "#DF1E1E",
"src": "location-alt"
},
"supports": {
"anchor": true
},
"keywords": [
"Carte",
"google",

View File

@ -3,6 +3,7 @@
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
$mapDatas = get_field('map_datas');
?>
@ -123,7 +124,7 @@ $mapDatas = get_field('map_datas');
})(jQuery);
</script>
<section class="homegrade-blocks-google-map">
<section id="<?php echo $block['anchor'] ?>" <?php echo get_block_wrapper_attributes(['class' => 'homegrade-blocks-google-map']); ?>>
<?php if ($mapDatas) : ?>
<div class="map_frame acf-map" data-zoom="16">
<div class="marker" data-lat="<?php echo esc_attr($mapDatas['lat']); ?>" data-lng="<?php echo esc_attr($mapDatas['lng']); ?>"></div>