Filters the Google Maps JavaScript configuration array used by the Map display format. The plugin builds the config from the sidebar settings (center, zoom, marker, custom styles, etc.) and runs it through this filter just before emitting it to the front end. Use it for low-level map customizations the sidebar doesn’t expose — extra map options, runtime-computed marker positions, conditional style overrides.
Parameters
apply_filters( 'afb/settings/map', $map_config, $field, $attr );Code language: PHP (php)
$map_config(array) — The map JS configuration object.$field(array) — The ACF field array.$attr(array) — The block attributes array.
Modifiers
| Tag | Applies to |
|---|---|
afb/settings/map | All ACF fields. |
afb/settings/map/type={$type} | All fields of a specific field type. |
afb/settings/map/name={$name} | All fields with a specific field name. |
afb/settings/map/key={$key} | A single field, matched by field key. |
Example
// Force a minimum zoom level for every Map block.
add_filter( 'afb/settings/map', function( $config ) {
if ( ! isset( $config['zoom'] ) || $config['zoom'] < 10 ) {
$config['zoom'] = 10;
}
return $config;
} );Code language: PHP (php)