settings = NIMAP_DATA::get_instance(); add_action( 'customize_register', array( $this, 'design_option_customizer' ) ); add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) ); add_action( 'customize_controls_enqueue_scripts', array( $this, 'customize_controls_enqueue_scripts' ) ); add_action( 'wp_print_styles', array( $this, 'customize_controls_print_styles' ) ); } public function design_option_customizer( $wp_customize ) { $wp_customize->add_panel( 'nimap_design', array( 'priority' => 200, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( '9Map Map Multi Locator', '9map-map-multi-locations' ), ) ); $this->add_section_design_general( $wp_customize ); $this->add_section_design_map( $wp_customize ); $this->add_section_design_information( $wp_customize ); $this->add_section_design_result( $wp_customize ); $this->add_section_design_search( $wp_customize ); $this->add_section_design_list( $wp_customize ); $this->add_section_design_detail( $wp_customize ); } protected function add_section_design_general( $wp_customize ) { $wp_customize->add_section( 'nimap_design_general', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'General', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[general_store_locator_type]', array( 'default' => $this->settings->get_default( 'general_store_locator_type' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[general_store_locator_type]', array( 'type' => 'select', 'section' => 'nimap_design_general', 'label' => esc_html__( 'Layout', '9map-map-multi-locations' ), 'choices' => array( '2col' => '2 Column', 'fullwidth' => 'Full width', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[general_distance_unit]', array( 'default' => $this->settings->get_default( 'general_distance_unit' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[general_distance_unit]', array( 'type' => 'select', 'section' => 'nimap_design_general', 'label' => esc_html__( 'Distance unit', '9map-map-multi-locations' ), 'choices' => array( 'ml' => 'Miles', 'km' => 'Kilometer', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[general_show_search_locator]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'general_show_search_locator' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[general_show_search_locator]', array( 'type' => 'checkbox', 'section' => 'nimap_design_general', 'label' => esc_html__( 'Show search field', '9map-map-multi-locations' ), 'description' => esc_html__( 'Allow customer search for store locator page', '9map-map-multi-locations' ), ) ); // $wp_customize->add_setting( 'nimap_multi_locator[general_information_title]', array( //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'default' => $this->settings->get_default( 'general_information_title' ), //// 'transport' => 'postMessage' //// ) ); //// $wp_customize->add_control( //// new NIMAP_Customize_Title_Control( //// $wp_customize, //// 'nimap_multi_locator[general_information_title]', //// array( //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Store information label', '9map-map-multi-locations' ), //// ) //// ) //// ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_title]', array( //// 'default' => $this->settings->get_default( 'general_store_title' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_title]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Store title', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_description]', array( //// 'default' => $this->settings->get_default( 'general_store_description' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_description]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Description', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_address]', array( //// 'default' => $this->settings->get_default( 'general_store_address' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_address]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Address', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_phone]', array( //// 'default' => $this->settings->get_default( 'general_store_phone' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_phone]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Phone', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_email]', array( //// 'default' => $this->settings->get_default( 'general_store_email' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_email]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Email', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_website]', array( //// 'default' => $this->settings->get_default( 'general_store_website' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_website]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Website', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_open_time]', array( //// 'default' => $this->settings->get_default( 'general_store_open_time' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_open_time]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Open time', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_category]', array( //// 'default' => $this->settings->get_default( 'general_store_category' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_category]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Category', '9map-map-multi-locations' ) //// ) ); //// $wp_customize->add_setting( 'nimap_multi_locator[general_store_zip]', array( //// 'default' => $this->settings->get_default( 'general_store_zip' ), //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'transport' => 'postMessage', //// ) ); //// $wp_customize->add_control( 'nimap_multi_locator[general_store_zip]', array( //// 'type' => 'text', //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Zip code', '9map-map-multi-locations' ) //// ) ); //// //// $wp_customize->add_setting( 'nimap_multi_locator[general_information_custom]', array( //// 'type' => 'option', //// 'capability' => 'manage_options', //// 'sanitize_callback' => 'sanitize_text_field', //// 'default' => $this->settings->get_default( 'general_information_custom' ), //// 'transport' => 'postMessage' //// ) ); //// $wp_customize->add_control( //// new NIMAP_Customize_Title_Control( //// $wp_customize, //// 'nimap_multi_locator[general_information_custom]', //// array( //// 'section' => 'nimap_design_general', //// 'label' => esc_html__( 'Custom code', '9map-map-multi-locations' ), //// ) //// ) //// ); $wp_customize->add_setting( 'nimap_multi_locator[general_store_css]', array( 'default' => $this->settings->get_default( 'general_store_css' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[general_store_css]', array( 'type' => 'textarea', 'section' => 'nimap_design_general', 'label' => esc_html__( 'Custom CSS', '9map-map-multi-locations' ) ) ); } protected function add_section_design_map( $wp_customize ) { $wp_customize->add_section( 'nimap_design_map', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'Map', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_zoom_level]', array( 'default' => $this->settings->get_default( 'map_zoom_level' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_zoom_level]', array( 'type' => 'select', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Load zoom level', '9map-map-multi-locations' ), 'choices' => array( '1' => '1 World view', '2' => '2', '3' => '3 Default', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12 Road view', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', ) ) ); $gg_lang = apply_filters( 'nimap_google_language', include NIMAP_TEMPLATES . 'google' . DIRECTORY_SEPARATOR . 'language.php' ); $wp_customize->add_setting( 'nimap_multi_locator[map_language]', array( 'default' => $this->settings->get_default( 'map_language' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_language]', array( 'type' => 'select', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Language', '9map-map-multi-locations' ), 'choices' => $gg_lang ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_style]', array( 'default' => $this->settings->get_default( 'map_style' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_style]', array( 'type' => 'select', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Map style', '9map-map-multi-locations' ), 'choices' => array( 'default' => esc_html__( 'Default', '9map-map-multi-locations' ), 'ultra-light-with-labels' => esc_html__( 'Ultra light with labels', '9map-map-multi-locations' ), 'subtle-grayscale' => esc_html__( 'Subtle Grayscale', '9map-map-multi-locations' ), 'shades-of-grey' => esc_html__( 'Shades of grey', '9map-map-multi-locations' ), 'blue-water' => esc_html__( 'Blue water', '9map-map-multi-locations' ), 'wy' => esc_html__( 'WY', '9map-map-multi-locations' ), 'vintage-old-golden-brown' => esc_html__( 'Vintage old golden brown', '9map-map-multi-locations' ), 'black-and-white' => esc_html__( 'Black and white', '9map-map-multi-locations' ), 'light-dream' => esc_html__( 'Light dream', '9map-map-multi-locations' ), 'blue-essence' => esc_html__( 'Blue essence', '9map-map-multi-locations' ), 'pale-dawn' => esc_html__( 'Pale dawn', '9map-map-multi-locations' ), 'unsaturated-browns' => esc_html__( 'Unsaturated browns', '9map-map-multi-locations' ), 'midnight-commander' => esc_html__( 'Midnight commander', '9map-map-multi-locations' ), 'light-monochrome' => esc_html__( 'Light monochrome', '9map-map-multi-locations' ), 'light-gray' => esc_html__( 'Light gray', '9map-map-multi-locations' ), 'custom' => esc_html__( 'Custom', '9map-map-multi-locations' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_custom_style]', array( 'default' => $this->settings->get_default( 'map_custom_style' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_custom_style]', array( 'type' => 'textarea', 'section' => 'nimap_design_map', 'description' => sprintf( '%s %s %s %s %s %s %s %s %s.', esc_html__( 'Styles must be properly a formatted Javascript array. Visit ', '9map-map-multi-locations' ), wp_kses_post( '' ), esc_html__( 'Google Maps Style Wizard', '9map-map-multi-locations' ), wp_kses_post( '' ), esc_html__( ' or ', '9map-map-multi-locations' ), wp_kses_post( '' ), esc_html__( 'Snazzy Maps', '9map-map-multi-locations' ), wp_kses_post( '' ), esc_html__( ' to generate properly formatted styles and paste it bellow.', '9map-map-multi-locations' ) ), 'label' => esc_html__( 'Custom map style', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_store_marker]', array( 'default' => $this->settings->get_default( 'map_store_marker' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_store_marker]', array( 'type' => 'select', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Store marker', '9map-map-multi-locations' ), 'choices' => array( 'simple' => 'Simple marker', 'custom' => 'Custom marker', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_store_marker_custom]', array( 'default' => $this->settings->get_default( 'map_store_marker_custom' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'nimap_multi_locator[map_store_marker_custom]', array( 'label' => esc_html__( 'Store custom marker', '9map-map-multi-locations' ), 'section' => 'nimap_design_map', 'settings' => 'nimap_multi_locator[map_store_marker_custom]', 'active_callback' => array( $this, 'nimap_map_store_marker_custom' ), ) ) ); // $wp_customize->add_setting( 'nimap_multi_locator[map_store_marker_color]', array( // 'default' => $this->settings->get_default( 'map_store_marker_color' ), // 'type' => 'option', // 'capability' => 'manage_options', // 'sanitize_callback' => 'sanitize_text_field', // 'transport' => 'postMessage', // ) ); // $wp_customize->add_control( // new NIMAP_Customize_Alpha_Color_Control( // $wp_customize, // 'nimap_multi_locator[map_store_marker_color]', // array( // 'label' => esc_html__( 'Store marker color', '9map-map-multi-locations' ), // 'section' => 'nimap_design_map', // 'show_opacity' => true, // 'palette' => 'default' // ) // ) // ); $wp_customize->add_setting( 'nimap_multi_locator[map_user_marker]', array( 'default' => $this->settings->get_default( 'map_user_marker' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_user_marker]', array( 'type' => 'select', 'section' => 'nimap_design_map', 'label' => esc_html__( 'User marker', '9map-map-multi-locations' ), 'choices' => array( 'simple' => 'Simple marker', 'custom' => 'Custom marker', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_user_marker_custom]', array( 'default' => $this->settings->get_default( 'map_user_marker_custom' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'nimap_multi_locator[map_user_marker_custom]', array( 'label' => esc_html__( 'User custom marker', '9map-map-multi-locations' ), 'section' => 'nimap_design_map', 'settings' => 'nimap_multi_locator[map_user_marker_custom]', 'active_callback' => array( $this, 'nimap_map_user_marker_custom' ), ) ) ); // $wp_customize->add_setting( 'nimap_multi_locator[map_user_marker_color]', array( // 'default' => $this->settings->get_default( 'map_user_marker_color' ), // 'type' => 'option', // 'capability' => 'manage_options', // 'sanitize_callback' => 'sanitize_text_field', // 'transport' => 'postMessage', // ) ); // $wp_customize->add_control( // new NIMAP_Customize_Alpha_Color_Control( // $wp_customize, // 'nimap_multi_locator[map_user_marker_color]', // array( // 'label' => esc_html__( 'User marker color', '9map-map-multi-locations' ), // 'section' => 'nimap_design_map', // 'show_opacity' => true, // 'palette' => 'default' // ) // ) // ); $wp_customize->add_setting( 'nimap_multi_locator[map_show_distance_radius]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'map_show_distance_radius' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[map_show_distance_radius]', array( 'type' => 'checkbox', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Distance radius', '9map-map-multi-locations' ), 'description' => esc_html__( 'Display distance radius around user location', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_radius_color]', array( 'default' => $this->settings->get_default( 'map_radius_color' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Alpha_Color_Control( $wp_customize, 'nimap_multi_locator[map_radius_color]', array( 'label' => esc_html__( 'Inner radius color', '9map-map-multi-locations' ), 'section' => 'nimap_design_map', 'show_opacity' => true, 'palette' => 'default', 'active_callback' => array( $this, 'nimap_map_distance_radius_custom' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_radius_border_color]', array( 'default' => $this->settings->get_default( 'map_radius_border_color' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Alpha_Color_Control( $wp_customize, 'nimap_multi_locator[map_radius_border_color]', array( 'label' => esc_html__( 'Border radius color', '9map-map-multi-locations' ), 'section' => 'nimap_design_map', 'show_opacity' => true, 'palette' => 'default', 'active_callback' => array( $this, 'nimap_map_distance_radius_custom' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_geolocation_title]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'map_geolocation_title' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( new NIMAP_Customize_Title_Control( $wp_customize, 'nimap_multi_locator[map_geolocation_title]', array( 'section' => 'nimap_design_map', 'label' => esc_html__( 'Auto geolocation', '9map-map-multi-locations' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_geolocation_text]', array( 'default' => $this->settings->get_default( 'map_geolocation_text' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_geolocation_text]', array( 'type' => 'text', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Confirm text', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[map_geolocation_button]', array( 'default' => $this->settings->get_default( 'map_geolocation_button' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[map_geolocation_button]', array( 'type' => 'text', 'section' => 'nimap_design_map', 'label' => esc_html__( 'Confirm button text', '9map-map-multi-locations' ) ) ); } protected function add_section_design_information( $wp_customize ) { $wp_customize->add_section( 'nimap_design_information', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'Information popup', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[info_display_fields]', array( 'default' => $this->settings->get_default( 'info_display_fields' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); // $wp_customize->add_control( // 'nimap_multi_locator[info_display_fields][]', array( // 'type' => 'select', // 'section' => 'nimap_design_information', // 'label' => esc_html__( 'Display fields', '9map-map-multi-locations' ), // // 'multiple' => true, // 'choices' => array( // 'image' => 'Image', // 'title' => 'Title', // 'address' => 'Address', // 'description' => 'Description', // 'phone' => 'Phone number', // 'email' => 'Email', // 'website' => 'Website', // 'open_time' => 'Open time', // 'category' => 'Category', // 'zip' => 'Zip Code', // 'custom' => 'Custom fields', // ) // ) // ); $wp_customize->add_control( new NIMAP_Customize_Select_Multiple_Control( $wp_customize, 'nimap_multi_locator[info_display_fields]', array( 'label' => esc_html__( 'Display fields', '9map-map-multi-locations' ), 'section' => 'nimap_design_information', 'choices' => array( 'image' => 'Image', 'title' => 'Title', 'address' => 'Address', 'description' => 'Description', 'phone' => 'Phone number', 'email' => 'Email', 'website' => 'Website', 'open_time' => 'Open time', 'category' => 'Category', 'zip' => 'Zip Code', 'distance' => 'Distance', 'custom' => 'Custom fields', ) ) ) ); //Custom button $wp_customize->add_setting( 'nimap_multi_locator[info_width]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'info_width' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[info_width]', array( 'type' => 'number', 'section' => 'nimap_design_information', 'label' => esc_html__( 'Width (px)', '9map-map-multi-locations' ), 'input_attrs' => array( 'min' => 0, 'step' => 1 ), ) ); // $wp_customize->add_setting( 'nimap_multi_locator[info_height]', array( // 'type' => 'option', // 'capability' => 'manage_options', // 'sanitize_callback' => 'sanitize_text_field', // 'default' => $this->settings->get_default( 'info_height' ), // 'transport' => 'postMessage', // ) ); // $wp_customize->add_control( 'nimap_multi_locator[info_height]', array( // 'type' => 'number', // 'section' => 'nimap_design_information', // 'label' => esc_html__( 'Height (px)', '9map-map-multi-locations' ), // 'input_attrs' => array( // 'min' => 0, // 'step' => 1 // ), // ) ); $wp_customize->add_setting( 'nimap_multi_locator[info_image_width]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'info_image_width' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[info_image_width]', array( 'type' => 'number', 'section' => 'nimap_design_information', 'label' => esc_html__( 'Image width (px)', '9map-map-multi-locations' ), 'input_attrs' => array( 'min' => 0, 'step' => 1 ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[info_buttons]', array( 'default' => $this->settings->get_default( 'info_buttons' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Buttons_Control( $wp_customize, 'nimap_multi_locator[info_buttons]', array( 'label' => esc_html__( 'Buttons', '9map-map-multi-locations' ), 'section' => 'nimap_design_information', ) ) ); } protected function add_section_design_result( $wp_customize ) { $wp_customize->add_section( 'nimap_design_result', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'Store result list', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'list_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[list_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_result', 'label' => esc_html__( 'Enable', '9map-map-multi-locations' ), 'description' => esc_html__( 'Show search result bellow search block', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_sort_by]', array( 'default' => $this->settings->get_default( 'list_sort_by' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[list_sort_by]', array( 'type' => 'select', 'section' => 'nimap_design_result', 'label' => esc_html__( 'Sort by', '9map-map-multi-locations' ), 'choices' => array( 'distance' => 'Distance', 'alphabet' => 'Alphabet', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_no_result_title]', array( 'default' => $this->settings->get_default( 'list_no_result_title' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[list_no_result_title]', array( 'type' => 'text', 'section' => 'nimap_design_result', 'label' => esc_html__( 'No result title', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_count_title]', array( 'default' => $this->settings->get_default( 'list_count_title' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[list_count_title]', array( 'type' => 'text', 'section' => 'nimap_design_result', 'label' => esc_html__( 'Number result title', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_paging_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'list_paging_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[list_paging_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_result', 'label' => esc_html__( 'Enable paging', '9map-map-multi-locations' ), 'description' => esc_html__( 'Separate store result list by page', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_paging_number]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'list_paging_number' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[list_paging_number]', array( 'type' => 'number', 'section' => 'nimap_design_result', 'label' => esc_html__( 'Max result per page', '9map-map-multi-locations' ), 'input_attrs' => array( 'min' => 0, 'step' => 1 ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_display_fields]', array( 'default' => $this->settings->get_default( 'list_display_fields' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Select_Multiple_Control( $wp_customize, 'nimap_multi_locator[list_display_fields]', array( 'label' => esc_html__( 'Store display fields', '9map-map-multi-locations' ), 'section' => 'nimap_design_result', 'choices' => array( 'image' => 'Image', 'title' => 'Title', 'address' => 'Address', 'description' => 'Description', 'phone' => 'Phone number', 'email' => 'Email', 'website' => 'Website', 'open_time' => 'Open time', 'category' => 'Category', 'zip' => 'Zip Code', 'custom' => 'Custom fields', ) ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[list_buttons]', array( 'default' => $this->settings->get_default( 'list_buttons' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Buttons_Control( $wp_customize, 'nimap_multi_locator[list_buttons]', array( 'label' => esc_html__( 'Buttons', '9map-map-multi-locations' ), 'section' => 'nimap_design_result', ) ) ); } protected function add_section_design_search( $wp_customize ) { $wp_customize->add_section( 'nimap_design_search', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'Search and filter', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_address_title]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'search_address_title' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( new NIMAP_Customize_Title_Control( $wp_customize, 'nimap_multi_locator[search_address_title]', array( 'section' => 'nimap_design_search', 'label' => esc_html__( 'Search location', '9map-map-multi-locations' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'search_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[search_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Enable', '9map-map-multi-locations' ), 'description' => esc_html__( 'Show search for address block', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_label]', array( 'default' => $this->settings->get_default( 'search_label' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[search_label]', array( 'type' => 'text', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Search location label', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_layout]', array( 'default' => $this->settings->get_default( 'search_layout' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[search_layout]', array( 'type' => 'select', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Layout', '9map-map-multi-locations' ), 'choices' => array( '2col' => '2 Column', 'fullwidth' => 'Full width', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_store_title]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'search_store_title' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( new NIMAP_Customize_Title_Control( $wp_customize, 'nimap_multi_locator[search_store_title]', array( 'section' => 'nimap_design_search', 'label' => esc_html__( 'Search stores', '9map-map-multi-locations' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_store_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'search_store_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[search_store_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Enable', '9map-map-multi-locations' ), 'description' => esc_html__( 'Show search for store', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_store_label]', array( 'default' => $this->settings->get_default( 'search_store_label' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[search_store_label]', array( 'type' => 'text', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Search store label', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_store_layout]', array( 'default' => $this->settings->get_default( 'search_store_layout' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[search_store_layout]', array( 'type' => 'select', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Layout', '9map-map-multi-locations' ), 'choices' => array( '2col' => '2 Column', 'fullwidth' => 'Full width', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[search_store_by_field]', array( 'default' => $this->settings->get_default( 'search_store_by_field' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[search_store_by_field]', array( 'type' => 'select', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Field to search', '9map-map-multi-locations' ), 'choices' => array( 'title' => 'Title', 'address' => 'Address', 'description' => 'Description', 'phone' => 'Phone number', 'email' => 'Email', 'website' => 'Website', 'zip' => 'Zip code', 'custom' => 'Custom field', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[filter_title]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'filter_title' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( new NIMAP_Customize_Title_Control( $wp_customize, 'nimap_multi_locator[filter_title]', array( 'section' => 'nimap_design_search', 'label' => esc_html__( 'Filter', '9map-map-multi-locations' ), ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[filter_distance_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'filter_distance_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[filter_distance_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Enable distance', '9map-map-multi-locations' ), // 'description' => esc_html__( 'Show search for store', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[filter_distance_label]', array( 'default' => $this->settings->get_default( 'filter_distance_label' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[filter_distance_label]', array( 'type' => 'text', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Distance label', '9map-map-multi-locations' ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[filter_category_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'filter_category_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[filter_category_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Enable category', '9map-map-multi-locations' ), // 'description' => esc_html__( 'Show search for store', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[filter_category_label]', array( 'default' => $this->settings->get_default( 'filter_category_label' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[filter_category_label]', array( 'type' => 'text', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Category label', '9map-map-multi-locations' ) ) ); // $wp_customize->add_setting( 'nimap_multi_locator[filter_status_enable]', array( // 'type' => 'option', // 'capability' => 'manage_options', // 'sanitize_callback' => 'sanitize_text_field', // 'default' => $this->settings->get_default( 'filter_status_enable' ), // 'transport' => 'postMessage' // ) ); // $wp_customize->add_control( 'nimap_multi_locator[filter_status_enable]', array( // 'type' => 'checkbox', // 'section' => 'nimap_design_search', // 'label' => esc_html__( 'Enable status', '9map-map-multi-locations' ), //// 'description' => esc_html__( 'Show search for store', '9map-map-multi-locations' ), // ) ); // $wp_customize->add_setting( 'nimap_multi_locator[filter_status_label]', array( // 'default' => $this->settings->get_default( 'filter_status_label' ), // 'type' => 'option', // 'capability' => 'manage_options', // 'sanitize_callback' => 'sanitize_text_field', // 'transport' => 'postMessage', // ) ); // $wp_customize->add_control( 'nimap_multi_locator[filter_status_label]', array( // 'type' => 'text', // 'section' => 'nimap_design_search', // 'label' => esc_html__( 'Status label', '9map-map-multi-locations' ) // ) ); $wp_customize->add_setting( 'nimap_multi_locator[filter_sort_by]', array( 'default' => $this->settings->get_default( 'filter_sort_by' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[filter_sort_by]', array( 'type' => 'select', 'section' => 'nimap_design_search', 'label' => esc_html__( 'Sort result by', '9map-map-multi-locations' ), 'choices' => array( 'distance' => 'Distance', 'title' => 'Title', ) ) ); } protected function add_section_design_list( $wp_customize ) { $wp_customize->add_section( 'nimap_design_list', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'Search page', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[store_layout]', array( 'default' => $this->settings->get_default( 'store_layout' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[store_layout]', array( 'type' => 'select', 'section' => 'nimap_design_list', 'label' => esc_html__( 'Layout', '9map-map-multi-locations' ), 'choices' => array( '2col' => '2 Column', 'fullwidth' => 'Full width', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[store_display_fields]', array( 'default' => $this->settings->get_default( 'store_display_fields' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Select_Multiple_Control( $wp_customize, 'nimap_multi_locator[store_display_fields]', array( 'label' => esc_html__( 'Store display fields', '9map-map-multi-locations' ), 'section' => 'nimap_design_list', 'choices' => array( 'image' => 'Image', 'title' => 'Title', 'address' => 'Address', 'description' => 'Description', 'phone' => 'Phone number', 'email' => 'Email', 'website' => 'Website', 'open_time' => 'Open time', 'category' => 'Category', 'zip' => 'Zip Code', 'custom' => 'Custom fields', ) ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[store_buttons]', array( 'default' => $this->settings->get_default( 'store_buttons' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Buttons_Control( $wp_customize, 'nimap_multi_locator[store_buttons]', array( 'label' => esc_html__( 'Store buttons', '9map-map-multi-locations' ), 'section' => 'nimap_design_list', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[store_result_column]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'store_result_column' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[store_result_column]', array( 'type' => 'number', 'section' => 'nimap_design_list', 'label' => esc_html__( 'Search result column', '9map-map-multi-locations' ), 'input_attrs' => array( 'min' => 0, 'step' => 1 ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[store_paging_enable]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'store_paging_enable' ), 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'nimap_multi_locator[store_paging_enable]', array( 'type' => 'checkbox', 'section' => 'nimap_design_list', 'label' => esc_html__( 'Enable paging', '9map-map-multi-locations' ), 'description' => esc_html__( 'Separate store result list by page', '9map-map-multi-locations' ), ) ); $wp_customize->add_setting( 'nimap_multi_locator[store_paging_number]', array( 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'default' => $this->settings->get_default( 'store_paging_number' ), 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[store_paging_number]', array( 'type' => 'number', 'section' => 'nimap_design_list', 'label' => esc_html__( 'Max result per page', '9map-map-multi-locations' ), 'input_attrs' => array( 'min' => 0, 'step' => 1 ), ) ); } protected function add_section_design_detail( $wp_customize ) { $wp_customize->add_section( 'nimap_design_detail', array( 'priority' => 20, 'capability' => 'manage_options', 'theme_supports' => '', 'title' => esc_html__( 'Store page', '9map-map-multi-locations' ), 'panel' => 'nimap_design', ) ); $wp_customize->add_setting( 'nimap_multi_locator[single_layout]', array( 'default' => $this->settings->get_default( 'single_layout' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'nimap_multi_locator[single_layout]', array( 'type' => 'select', 'section' => 'nimap_design_detail', 'label' => esc_html__( 'Layout', '9map-map-multi-locations' ), 'choices' => array( '2col' => '2 Column', 'fullwidth' => 'Full width', ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[single_display_fields]', array( 'default' => $this->settings->get_default( 'single_display_fields' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'villatheme_sanitize_fields', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Select_Multiple_Control( $wp_customize, 'nimap_multi_locator[single_display_fields]', array( 'label' => esc_html__( 'Display fields', '9map-map-multi-locations' ), 'section' => 'nimap_design_detail', 'choices' => array( // 'image' => 'Image', 'title' => 'Title', 'address' => 'Address', 'description' => 'Description', 'phone' => 'Phone number', 'email' => 'Email', 'website' => 'Website', 'open_time' => 'Open time', 'category' => 'Category', 'zip' => 'Zip Code', 'custom' => 'Custom fields', ) ) ) ); $wp_customize->add_setting( 'nimap_multi_locator[single_buttons]', array( 'default' => $this->settings->get_default( 'single_buttons' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new NIMAP_Customize_Buttons_Control( $wp_customize, 'nimap_multi_locator[single_buttons]', array( 'label' => esc_html__( 'Buttons', '9map-map-multi-locations' ), 'section' => 'nimap_design_detail', ) ) ); } public function customize_controls_print_styles() { if ( ! is_customize_preview() ) { return; } global $wp_customize; $this->customize = $wp_customize; ?> settings->enqueue_style( array( 'nimap-customize', ), array( 'nimap-customize' ), array( 0 ) ); $this->settings->enqueue_script( array( 'nimap-customize' ), array( 'nimap-customize' ), array( 0 ), array( array( 'jquery', 'jquery-ui-button' ) ), 'enqueue', true ); $setting_data = $this->settings->get_params(); $args = array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'nimap_nonce' ), 'initData' => villatheme_sanitize_fields( $this->settings->get_params() ), 'locatorUrl' => esc_js( get_permalink( $this->settings->get_page_locator( 'general_store_locator' ) ) ), 'storeListUrl' => esc_js( get_permalink( $this->settings->get_page_locator( 'general_store_list' ) ) ), 'storeDetailUrl' => esc_js( get_permalink( $this->settings->get_page_locator( 'general_store_detail' ) ) ), 'buttonRemoveNotice' => esc_html__( 'Remove this button', '9map-map-multi-locations' ), 'buttonLabelStore' => esc_html__( 'Store', '9map-map-multi-locations' ), 'buttonLabelWebsite' => esc_html__( 'Website', '9map-map-multi-locations' ), 'buttonLabelRoute' => esc_html__( 'Route', '9map-map-multi-locations' ), 'buttonLabelAction' => esc_html__( 'Select action', '9map-map-multi-locations' ), ); wp_localize_script( 'nimap-customize', 'nimap_customize', $args ); } public function customize_preview_init() { $this->settings->enqueue_script( array( 'nimap-customize-preview' ), array( 'nimap-customize-preview' ), array( 0 ), array( array( 'jquery', 'customize-preview' ) ), 'enqueue', true ); $mapStyleSource = array( 'default' => 'default', 'ultra-light-with-labels' => 'ultra-light-with-labels', 'subtle-grayscale' => 'subtle-grayscale', 'shades-of-grey' => 'shades-of-grey', 'blue-water' => 'blue-water', 'wy' => 'wy', 'vintage-old-golden-brown' => 'vintage-old-golden-brown', 'black-and-white' => 'black-and-white', 'light-dream' => 'light-dream', 'blue-essence' => 'blue-essence', 'pale-dawn' => 'pale-dawn', 'unsaturated-browns' => 'unsaturated-browns', 'midnight-commander' => 'midnight-commander', 'light-monochrome' => 'light-monochrome', 'light-gray' => 'light-gray', 'custom' => 'custom', ); foreach ( $mapStyleSource as $msKey => $msVal ) { $mapStyleSource[ $msKey ] = NIMAP_MULTI_LOCATOR_Function::mapStyle( $msKey, $this->settings->get_params( 'map_custom_style' ) ); } $args = array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'badgesData' => villatheme_sanitize_fields( $this->settings->get_params() ), 'tabLayout' => $this->settings->get_params( 'tab_layout' ), 'tabOpenType' => $this->settings->get_params( 'tab_open_type' ), 'iconValue' => villatheme_sanitize_fields( $this->settings->get_default( 'icon_data' ) ), 'mapStyleData' => villatheme_sanitize_fields( $mapStyleSource ), ); wp_localize_script( 'nimap-customize-preview', 'nimap_preview', $args ); } function nimap_title_layout_active_callback() { return $this->settings->get_params( 'tab_layout' ) == 'horizontal'; } function nimap_map_store_marker_custom() { return $this->settings->get_params( 'map_store_marker' ) == 'custom'; } function nimap_map_user_marker_custom() { return $this->settings->get_params( 'map_user_marker' ) == 'custom'; } function nimap_map_distance_radius_custom() { return $this->settings->get_params( 'map_show_distance_radius' ) == 1; } } ?>