<?php
if (!function_exists( 'confin_button_kc_map' ) ) {
  add_action('init', 'confin_button_kc_map', 99 );
  function confin_button_kc_map() {
    kc_add_map(
      array(
        'confin_button' => array(
          'name' => esc_html__('Confin Button', 'confin-core'),
          'description' => esc_html__( 'Button Styles', 'confin-core' ),
          'category' => ConfinLibrary::confin_kc_cat_name(),
          'icon' => 'cpicon kc-icon-button',
          'title' => esc_html__('Button Settings', 'confin-core'),
          'params' => array(
            esc_html__( 'General', 'confin-core' ) => array(
              array(
                  'name' => 'button_style',
                  'label' => esc_html__('Button Style', 'confin-core'),
                  'type' => 'select',
                  'options' => array(
                    'standard' => esc_html__( 'Standard', 'confin-core' ),
                    'classic' => esc_html__( 'Classic', 'confin-core' ),
                  ),
                ),
              array(
                'name' => 'title',
                'label' => esc_html__('Button Title', 'confin-core'),
                'type' => 'text',
                'admin_label' => true
              ),
              array(
                'name' => 'link',
                'label' => esc_html__('Button Link', 'confin-core'),
                'type' => 'link',
                'admin_label' => true,
                'description' => esc_html__( 'Add your relative URL. Each URL contains link, anchor text and target attributes.', 'confin-core' ),
              ),
              array(
                'name' => 'class',
                'label' => esc_html__('Extra class name', 'confin-core'),
                'type' => 'text',
                'description' => esc_html__(' ', 'confin-core')
              )
            ),
            esc_html__( 'Style', 'confin-core' ) => array(
              array(
                'name' => 'button_color',
                'label' => esc_html__('Button Text Color', 'confin-core'),
                'type' => 'color_picker'
              ),
              array(
                'name' => 'button_size',
                'label' => esc_html__('Button Text Size', 'confin-core'),
                'type' => 'number_slider',
                'options' => array(
                  'min' => 14,
                  'max' =>24,
                  'unit' => 'px',
                  'show_input' => true
                ),
              ),
              array(
                'name' => 'background',
                'label' => esc_html__('Background Color', 'confin-core'),
                'type' => 'color_picker'
              ),
              array(
                'name' => 'hover_color',
                'label' => esc_html__('Hover Color', 'confin-core'),
                'type' => 'color_picker'
              ),
              array(
                'name' => 'hover_bg',
                'label' => esc_html__('Hover Background', 'confin-core'),
                'type' => 'color_picker'
              ),
              array(
                'name' => 'border_color',
                'label' => esc_html__('Border Color', 'confin-core'),
                'type' => 'color_picker'
              ),
              array(
                'name' => 'border_hover_color',
                'label' => esc_html__('Border Color', 'confin-core'),
                'type' => 'color_picker'
              ),
              array(
                'name' => 'border_size',
                'label' => esc_html__('Border Size', 'confin-core'),
                'type' => 'number_slider',
                'options' => array(
                  'min' => 2,
                  'max' => 5,
                  'unit' => 'px',
                  'show_input' => true
                ),
              ),
            ),
          )
        ),
      )
    ); // End add map
  }
} // End if