<?php
/**
 *  Faced Boxed Option
 *
 * @since Faced 1.0.0
 *
 */
/* Header Types Options*/
$wp_customize->add_section( 'faced_category_boxes_section', array(
    'priority'       => 25,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
    'title'          => __( 'Category Boxes Options', 'faced' ),
    'panel' 		 => 'faced_panel',
) );
/*Enable Boxes*/
$wp_customize->add_setting( 'faced_options[faced-enable-category-boxes]', array(
 'capability'        => 'edit_theme_options',
 'transport' => 'refresh',
 'default'           => $default['faced-enable-category-boxes'],
 'sanitize_callback' => 'faced_sanitize_checkbox'
) );
$wp_customize->add_control( 'faced_options[faced-enable-category-boxes]', array(
 'label'     => __( 'Enable Category Boxes Section', 'faced' ),
 'description' => __('Checked to show category boxes section in Home Page.', 'faced'),
 'section'   => 'faced_category_boxes_section',
 'settings'  => 'faced_options[faced-enable-category-boxes]',
 'type'      => 'checkbox',
 'priority'  => 10,
) );

/*callback functions header section*/
if ( !function_exists('faced_category_enable_boxes_callback') ) :
  function faced_category_enable_boxes_callback(){
      global $faced_theme_options;
      $faced_theme_options = faced_get_options_value();
      $enable_box = absint($faced_theme_options['faced-enable-category-boxes']);
      if( true == $enable_box ){
          return true;
      }
      else{
          return false;
      }
  }
endif;

/*Boxes Category*/
$wp_customize->add_setting( 'faced_options[faced-single-cat-posts-select-1]', array(
  'capability'        => 'edit_theme_options',
  'transport' => 'refresh',
  'default'           => $default['faced-single-cat-posts-select-1'],
  'sanitize_callback' => 'absint'
) );
$wp_customize->add_control(
  new Faced_Customize_Category_Dropdown_Control(
    $wp_customize,
    'faced_options[faced-single-cat-posts-select-1]',
    array(
      'label'     => __( 'Select Category', 'faced' ),
      'description' => __('Three Posts from the same category will appear.', 'faced'),
      'section'   => 'faced_category_boxes_section',
      'settings'  => 'faced_options[faced-single-cat-posts-select-1]',
      'type'      => 'category_dropdown',
      'priority'  => 10,
      'active_callback'=>'faced_category_enable_boxes_callback'
    )
  )
);
