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

if ( ! function_exists( 'business_carter_get_default_theme_options' ) ) :

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

	$defaults = array();

    // Homepage Options
	$defaults['enable_frontpage_content'] 			= true;

	// Featured Slider Section	
	$defaults['enable_featured_slider_section']					    = false;
	$defaults['business_carter_number_of_featured_slider_items']	= 3;

	// Call to action Section	
	$defaults['enable_call_to_action_section']	   				    = false;
	$defaults['business_carter_call_to_action_title']	   	 		= esc_html__( 'Looking for a first-class business consultant?', 'business-carter' );
	$defaults['business_carter_call_to_action_button_label']	   	= esc_html__( 'Get A Quote', 'business-carter' );
	$defaults['business_carter_call_to_action_button_url']	   	 	= '#';

	// About Us Section	
	$defaults['enable_about_us_section']							= false;
	$defaults['business_carter_about_us_subtitle']					= esc_html__( 'Welcome to Business Carter', 'business-carter' );
	$defaults['business_carter_about_us_title']						= esc_html__( 'We provide complete HR solutions.', 'business-carter' );
	$defaults['business_carter_about_us_btn_label']					= esc_html__( 'Find Out More', 'business-carter' );

	// Choose Us Section	
	$defaults['enable_choose_us_section']							= false;
	$defaults['business_carter_choose_us_section_subtitle']			= esc_html__( 'Why Choose Us', 'business-carter' );
	$defaults['business_carter_choose_us_section_title']			= esc_html__( 'Where We Can Help You', 'business-carter' );
	$defaults['business_carter_choose_us_btn_label']				= esc_html__( 'Learn More', 'business-carter' );
	$defaults['business_carter_number_of_choose_us_items']			= 6;

	// Latest Posts Section
	$defaults['enable_blog_section']								= false;
	$defaults['business_carter_blog_section_subtitle']				= esc_html__( 'Articles', 'business-carter' );
	$defaults['business_carter_blog_section_title']					= esc_html__( 'Latest News', 'business-carter' );
	$defaults['business_carter_blog_category']	   					= 0; 
	$defaults['business_carter_blog_number']						= 3;

	//General Section
	$defaults['your_latest_posts_title']			= esc_html__('Blog','business-carter');
	$defaults['excerpt_length']						= 15;
	$defaults['layout_options_blog']				= 'no-sidebar';
	$defaults['layout_options_archive']				= 'no-sidebar';
	$defaults['layout_options_page']				= 'no-sidebar';	
	$defaults['layout_options_single']				= 'right-sidebar';	

	//Footer section 		
	$defaults['copyright_text']					= esc_html__( '© Copyright 2022 Agency Name | All Rights Reserved.', 'business-carter' );

	// Pass through filter.
	$defaults = apply_filters( 'business_carter_filter_default_theme_options', $defaults );
	return $defaults;
}

endif;

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

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

		$default_options = business_carter_get_default_theme_options();
		if ( empty( $key ) ) {
			return;
		}

		$theme_options = (array)get_theme_mod( 'theme_options' );
		$theme_options = wp_parse_args( $theme_options, $default_options );

		$value = null;

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

		return $value;

	}

endif;