$key, 'style' => deltabreen_maps_clean_style( $input['style'] ?? 'meadow' ), 'height' => deltabreen_maps_clean_height( $input['height'] ?? '400px' ), 'language' => deltabreen_maps_clean_language( $input['language'] ?? '' ), 'units' => deltabreen_maps_clean_units( $input['units'] ?? '' ), 'countries' => deltabreen_maps_clean_countries( $input['countries'] ?? '' ), 'directions' => deltabreen_maps_clean_directions( $input['directions'] ?? 'auto' ), 'consent' => ! empty( $input['consent'] ) ? 'click' : '', 'lazy' => deltabreen_maps_clean_lazy( $input['lazy'] ?? '' ), 'controls' => deltabreen_maps_clean_controls( $input['controls'] ?? '' ), 'gestures' => deltabreen_maps_clean_gestures( $input['gestures'] ?? '' ), 'accent' => deltabreen_maps_clean_accent( $input['accent'] ?? '' ), 'theme' => deltabreen_maps_clean_theme( $input['theme'] ?? '' ), 'public_locations' => ! empty( $input['public_locations'] ) ? '1' : '', 'location_pages' => ! empty( $input['location_pages'] ) ? '1' : '', 'cookie_tool' => in_array( $input['cookie_tool'] ?? 'auto', array_merge( array( 'auto', 'none' ), array_keys( DELTABREEN_MAPS_COOKIE_TOOLS ) ), true ) ? $input['cookie_tool'] : 'auto', 'cookie_category' => substr( preg_replace( '/[^A-Za-z0-9_\-]/', '', (string) ( $input['cookie_category'] ?? '' ) ), 0, 60 ), 'place_types' => array_values( array_intersect( array_map( 'sanitize_key', (array) ( $input['place_types'] ?? array() ) ), array_keys( deltabreen_maps_place_type_choices() ) ) ), 'place_source' => in_array( $input['place_source'] ?? '', array( 'acf', 'meta' ), true ) ? $input['place_source'] : 'box', 'place_acf' => sanitize_key( $input['place_acf'] ?? '' ), 'place_meta_lat' => preg_replace( '/[^A-Za-z0-9_\-]/', '', (string) ( $input['place_meta_lat'] ?? '' ) ), 'place_meta_lng' => preg_replace( '/[^A-Za-z0-9_\-]/', '', (string) ( $input['place_meta_lng'] ?? '' ) ), ); } add_action( 'admin_init', function () { register_setting( 'deltabreen_maps', 'deltabreen_maps', array( 'sanitize_callback' => 'deltabreen_maps_sanitize' ) ); } ); add_action( 'admin_enqueue_scripts', function ( $hook ) { if ( 'settings_page_deltabreen-maps' !== $hook ) { return; } deltabreen_maps_enqueue_admin(); wp_enqueue_script( 'deltabreen-maps-settings', plugins_url( 'admin/settings.js', __FILE__ ), array( 'deltabreen-maps-admin', 'wp-i18n' ), DELTABREEN_MAPS_VERSION, true ); deltabreen_maps_script_translations( 'deltabreen-maps-settings' ); wp_enqueue_script( 'deltabreen-maps-shortcode', plugins_url( 'admin/shortcode.js', __FILE__ ), array( 'wp-i18n' ), DELTABREEN_MAPS_VERSION, true ); deltabreen_maps_script_translations( 'deltabreen-maps-shortcode' ); wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); wp_add_inline_script( 'wp-color-picker', 'jQuery(function ($) { $(".deltabreen-color").wpColorPicker(); });' ); } ); add_action( 'admin_menu', function () { add_options_page( __( 'Maps by DeltaBreen', 'maps-by-deltabreen' ), __( 'Maps by DeltaBreen', 'maps-by-deltabreen' ), 'manage_options', 'deltabreen-maps', 'deltabreen_maps_settings_page' ); } ); /** The settings screen. */ function deltabreen_maps_settings_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $o = deltabreen_maps_options(); $host = wp_parse_url( home_url(), PHP_URL_HOST ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- only picks which message to show. $result = isset( $_GET['deltabreen_connect'] ) ? sanitize_key( wp_unslash( $_GET['deltabreen_connect'] ) ) : ''; $message = '' !== $result ? deltabreen_maps_connect_message( $result ) : null; ?>

' . esc_html( (string) $host ) . '' ); ?>

[deltabreen_map center="-6.26,53.35" zoom="13" marker="true"]

[deltabreen_map][deltabreen_pin lnglat="-6.26,53.35" title="Our office" color="#1d4ed8"]Ring the bell[/deltabreen_pin][/deltabreen_map]

[deltabreen_map map="…"]

' . esc_html__( 'Map locations', 'maps-by-deltabreen' ) . '' ); ?>

[deltabreen_store_locator radius="25"]

[deltabreen_map]