<?php
/**
 * About Us options.
 *
 * @package Super Business
 */

$default = super_business_get_default_theme_options();

// About Us Section
$wp_customize->add_section( 'section_about_us',
	array(
	'title'      		=> __( 'About Us Section', 'super-business' ),
	'priority'   		=> 100,
	'capability' 		=> 'edit_theme_options',
	'panel'      		=> 'home_page_panel',
	)
);

// Enable About Us Section
$wp_customize->add_setting('theme_options[enable_about_us_section]', 
	array(
	'default' 			=> $default['enable_about_us_section'],
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',
	'sanitize_callback' => 'super_business_sanitize_checkbox'
	)
);

$wp_customize->add_control('theme_options[enable_about_us_section]', 
	array(		
	'label' 			=> __('Enable Section', 'super-business'),
	'description' => __('Go to Customize - Homepage Settings. Select A static page. Set Homepage as Home and Posts page as Blog to show this section.', 'super-business'),
	'section' 			=> 'section_about_us',
	'settings'  		=> 'theme_options[enable_about_us_section]',
	'type' 				=> 'checkbox',	
	)
);

// Image
$wp_customize->add_setting('theme_options[about_us_image]', 
	array(
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'super_business_sanitize_image'
	)
);

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,
	'theme_options[about_us_image]', 
	array(
	'label' 			=> __('Image', 'super-business'),
	'section'     		=> 'section_about_us',   
	'settings'    		=> 'theme_options[about_us_image]',		
	'active_callback' 	=> 'super_business_about_us_active',
	'type'        		=> 'image',
	)
	)
);

// Subtitle
$wp_customize->add_setting('theme_options[about_us_subtitle]', 
	array(
	'default' 			=> $default['about_us_subtitle'],
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control('theme_options[about_us_subtitle]', 
	array(
	'label' 	  		=> __('Subtitle', 'super-business'),
	'section'     		=> 'section_about_us',   
	'settings'    		=> 'theme_options[about_us_subtitle]',		
	'active_callback' 	=> 'super_business_about_us_active',		
	'type'        		=> 'text'
	)
);

// Title
$wp_customize->add_setting('theme_options[about_us_title]', 
	array(
	'default' 			=> $default['about_us_title'],
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control('theme_options[about_us_title]', 
	array(
	'label' 			=> __('Title', 'super-business'),
	'section'       	=> 'section_about_us',   
	'settings'      	=> 'theme_options[about_us_title]',		
	'active_callback' 	=> 'super_business_about_us_active',		
	'type'        		=> 'text'
	)
);

// Content
$wp_customize->add_setting('theme_options[about_us_content]', 
	array(
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'super_business_sanitize_textarea_content'
	)
);

$wp_customize->add_control('theme_options[about_us_content]', 
	array(
	'label'       		=> sprintf( __('Content', 'super-business')),
	'section'     		=> 'section_about_us',   
	'settings'    		=> 'theme_options[about_us_content]',		
	'active_callback' 	=> 'super_business_about_us_active',		
	'type'        		=> 'textarea'
	)
);

// Button Label
$wp_customize->add_setting('theme_options[about_us_btn_label]', 
	array(
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control('theme_options[about_us_btn_label]', 
	array(
	'label'       		=> sprintf( __('Button Label', 'super-business')),
	'section'     		=> 'section_about_us',   
	'settings'    		=> 'theme_options[about_us_btn_label]',		
	'active_callback' 	=> 'super_business_about_us_active',		
	'type'        		=> 'text'
	)
);

// Button Url
$wp_customize->add_setting('theme_options[about_us_btn_url]', 
	array(
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'esc_url_raw'
	)
);

$wp_customize->add_control('theme_options[about_us_btn_url]', 
	array(
	'label'       		=> sprintf( __('Button Url', 'super-business')),
	'section'     		=> 'section_about_us',   
	'settings'    		=> 'theme_options[about_us_btn_url]',		
	'active_callback' 	=> 'super_business_about_us_active',		
	'type'        		=> 'url'
	)
);