<?php

function jenny_misc_options( $wp_customizer ) {

	/**
	 * Jenny Misc Options Section
	 */
	$wp_customizer->add_section( 'jenny_misc_section', array(
		'title'                 =>  esc_html__( 'Misc Settings', 'jenny' ),
		'panel'                 =>  'jenny_panel'
	) );

	/**
	 * Hindi Devanagari Font
	 */
	$wp_customizer->add_setting( 'jenny_font_hindi', array(
		'default'               =>  1,
		'sanitize_callback'     =>  'jenny_checkbox_sanitize',
		'transport'             =>  'refresh'
	) );
	$wp_customizer->add_control(
		new WP_Customize_Control(
			$wp_customizer,
			'jenny_font_hindi',
			array(
				'label'         =>  esc_html__( 'Enable Hindi Devanagari Font', 'jenny' ),
				'section'       =>  'jenny_misc_section',
				'settings'      =>  'jenny_font_hindi',
				'type'          =>  'checkbox'
			)
		)
	);

	/**
	 * Show Author Bio
	 */
	$wp_customizer->add_setting( 'jenny_author_bio', array(
		'default'               =>  1,
		'sanitize_callback'     =>  'jenny_checkbox_sanitize',
		'transport'             =>  'refresh'
	) );
	$wp_customizer->add_control(
		new WP_Customize_Control(
			$wp_customizer,
			'jenny_author_bio_input',
			array(
				'label'         =>  esc_html__( 'Show Author Description in Posts', 'jenny' ),
				'section'       =>  'jenny_misc_section',
				'settings'      =>  'jenny_author_bio',
				'type'          =>  'checkbox'
			)
		)
	);

	/**
	 * Bootstrap
	 */
	$wp_customizer->add_setting( 'jenny_bootstrap', array(
		'default'               =>  1,
		'sanitize_callback'     =>  'jenny_checkbox_sanitize',
		'transport'             =>  'refresh'
	) );
	$wp_customizer->add_control(
		new WP_Customize_Control(
			$wp_customizer,
			'jenny_bootstrap',
			array(
				'label'         =>  esc_html__( 'Include Full Bootstrap CSS & JS', 'jenny' ),
				'section'       =>  'jenny_misc_section',
				'settings'      =>  'jenny_bootstrap',
				'type'          =>  'checkbox'
			)
		)
	);

}

function jenny_social_search_check() {
	$jenny_facebook_handle       =   get_theme_mod( 'jenny_facebook_handle' );
	$jenny_twitter_handle        =   get_theme_mod( 'jenny_twitter_handle' );
	$jenny_google_plus_handle    =   get_theme_mod( 'jenny_google_plus_handle' );
	$jenny_linkedin_handle       =   get_theme_mod( 'jenny_linkedin_handle' );
	$jenny_instagram_handle      =   get_theme_mod( 'jenny_instagram_handle' );
	$jenny_pinterest_handle      =   get_theme_mod( 'jenny_pinterest_handle' );
	$jenny_email_handle          =   get_theme_mod( 'jenny_email_handle' );

	if( $jenny_facebook_handle || $jenny_twitter_handle || $jenny_google_plus_handle || $jenny_linkedin_handle || $jenny_instagram_handle || $jenny_pinterest_handle || $jenny_email_handle ) :
		return 1;
	else :
		return 0;
	endif;

}