<?php
/**
 * Default theme options.
 *
 * @package Spirit Business
 */

if ( ! function_exists( 'spirit_business_get_default_theme_options' ) ) :

	/**
	 * Get default theme options.
	 *
	 * @since 1.0.0
	 *
	 * @return array Default theme options.
	 */
function spirit_business_get_default_theme_options() {

	$spirit_business_defaults = array();

	// Contact Details
	$spirit_business_defaults['spirit_business_show_contact_details'] 		= true;
	$spirit_business_defaults['spirit_business_address_one']				= esc_html__('214 West Arnold St','spirit-business');
	$spirit_business_defaults['spirit_business_address_two']				= esc_html__('New York, NY 10002','spirit-business');
	$spirit_business_defaults['spirit_business_phone_number']				= esc_html__('(007) 123 456 7890','spirit-business');
	$spirit_business_defaults['spirit_business_opening_time']				= esc_html__('Mon-Fri 10:00am-7:30pm','spirit-business');
	$spirit_business_defaults['spirit_business_email_id']					= esc_html__('info@example.com','spirit-business');
	$spirit_business_defaults['spirit_business_support_text']				= esc_html__('24 X 7 online support','spirit-business');

	// Menu
	$spirit_business_defaults['spirit_business_show_menu_button'] 			= true;
	$spirit_business_defaults['spirit_business_menu_button_text']			= esc_html__('Get A Quote','spirit-business');
	$spirit_business_defaults['spirit_business_menu_button_url']			= esc_url('#','spirit-business');

	// Front Page Header Image
	$spirit_business_defaults['enable_frontpage_header_image']  = false;

	// Featured Slider Section	
	$spirit_business_defaults['enable_featured_slider_section']		= true;
	$spirit_business_defaults['number_of_featured_slider_items']	= 3;
	$spirit_business_defaults['data_slick_speed']					= 1000;
	$spirit_business_defaults['data_slick_arrows']					= 1;
	$spirit_business_defaults['data_slick_dots']					= 1;
	$spirit_business_defaults['data_slick_fade']					= 1;
	$spirit_business_defaults['data_slick_infinite']				= 1;
	$spirit_business_defaults['data_slick_autoplay']				= 0;
	$spirit_business_defaults['data_slick_draggable']				= 1;
	$spirit_business_defaults['featured_slider_content_type']		= 'featured_slider_category';

	// Our Services Section	
	$spirit_business_defaults['enable_our_services_section']		= true;
	$spirit_business_defaults['our_services_section_sub_title']	   	 	= esc_html__( 'We Are Good At', 'spirit-business' );
	$spirit_business_defaults['our_services_section_title']	   	 	= esc_html__( 'Our Professional Services.', 'spirit-business' );
	$spirit_business_defaults['number_of_our_services_items']		= 3;
	$spirit_business_defaults['our_services_content_type']			= 'our_services_category';

	// Call to action Section	
	$spirit_business_defaults['enable_call_to_action_section']	   	= true;
	$spirit_business_defaults['call_to_action_title']	   	 		= esc_html__( 'We Provide Business Planing Solution', 'spirit-business' );
	$spirit_business_defaults['call_to_action_content']	   		= esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididu.', 'spirit-business' );
	$spirit_business_defaults['call_to_action_button_label']	   	= esc_html__( 'Contact Us', 'spirit-business' );
	$spirit_business_defaults['call_to_action_button_url']	   	 	= '#';

	// Latest Posts Section
	$spirit_business_defaults['enable_latest_posts_section']		= true;
	$spirit_business_defaults['latest_posts_section_sub_title']	   	= esc_html__( 'Latest Posts', 'spirit-business' );
	$spirit_business_defaults['latest_posts_section_title']	   	 	= esc_html__( 'Check Out Our Latest Blog Posts.', 'spirit-business' );

	//General Section
	$spirit_business_defaults['readmore_text']					= esc_html__('Read More','spirit-business');
	$spirit_business_defaults['your_latest_posts_title']		= esc_html__('Blog','spirit-business');
	$spirit_business_defaults['excerpt_length']					= 10;
	$spirit_business_defaults['layout_options_blog']			= 'no-sidebar';
	$spirit_business_defaults['layout_options_archive']			= 'no-sidebar';
	$spirit_business_defaults['layout_options_page']			= 'no-sidebar';	
	$spirit_business_defaults['layout_options_single']			= 'right-sidebar';	

	//Footer section 		
	$spirit_business_defaults['copyright_text']					= esc_html__( 'Copyright &copy; All rights reserved.', 'spirit-business' );

	// Pass through filter.
	$spirit_business_defaults = apply_filters( 'spirit_business_filter_default_theme_options', $spirit_business_defaults );
	return $spirit_business_defaults;
}

endif;

/**
*  Get theme options
*/
if ( ! function_exists( 'spirit_business_get_option' ) ) :

	/**
	 * Get theme option
	 *
	 * @since 1.0.0
	 *
	 * @param string $key Option key.
	 * @return mixed Option value.
	 */
	function spirit_business_get_option( $key ) {

		$spirit_business_default_options = spirit_business_get_default_theme_options();
		if ( empty( $key ) ) {
			return;
		}

		$spirit_business_theme_options = (array)get_theme_mod( 'theme_options' );
		$spirit_business_theme_options = wp_parse_args( $spirit_business_theme_options, $spirit_business_default_options );

		$value = null;

		if ( isset( $spirit_business_theme_options[ $key ] ) ) {
			$value = $spirit_business_theme_options[ $key ];
		}

		return $value;

	}

endif;