<?php
/**
 * Default theme options.
 *
 * @package UniKids
 */

if ( ! function_exists( 'unikids_get_default_theme_options' ) ) :

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

	$defaults = array();

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

	// Featured Slider Section	
	$defaults['enable_featured_slider_section']		= false;
	$defaults['number_of_featured_slider_items']	= 3;
	$defaults['slider_btn_text']					= esc_html__('Get Started','unikids');

	// Featured Services Section	
	$defaults['enable_featured_services_section']	= false;
	$defaults['number_of_featured_services_items']	= 3;

	// Featured Gallery Section	
	$defaults['enable_featured_gallery_section']		= false;
	$defaults['featured_gallery_section_title']			= esc_html__( 'Childhood Memories', 'unikids' );
	$defaults['featured_gallery_section_subtitle']		= esc_html__( 'Captured Moments of Joy: Exploring Our Kids Gallery', 'unikids' );
	$defaults['number_of_featured_gallery_items']		= 6;

	// Featured Classes Section	
	$defaults['enable_featured_classes_section']		= false;
	$defaults['featured_classes_section_title']			= esc_html__( 'Sparks of knowledge', 'unikids' );
	$defaults['featured_classes_section_subtitle']		= esc_html__( 'Our Featured Classes', 'unikids' );
	$defaults['number_of_featured_classes_items']		= 3;
	$defaults['featured_classes_button_text']			= esc_html__('Learn More','unikids');

	// Featured Team Section	
	$defaults['enable_featured_team_section']		= false;
	$defaults['featured_team_section_title']		= esc_html__( 'Meet Our Dedicated Educators', 'unikids' );
	$defaults['featured_team_section_subtitle']		= esc_html__( 'Our Professional Teachers', 'unikids' );
	$defaults['number_of_featured_team_items']		= 5;

	// Latest Posts Section
	$defaults['enable_blog_section']		= false;
	$defaults['blog_section_title']			= esc_html__( 'A Childs Lifelong Learning Journey', 'unikids' );
	$defaults['blog_section_subtitle']		= esc_html__( 'Childs first step into the world of structured learning', 'unikids' );
	$defaults['blog_category']	   			= 0; 
	$defaults['blog_number']				= 3;

	//General Section
	$defaults['your_latest_posts_title']		= esc_html__('Blog','unikids');
	$defaults['excerpt_length']					= 25;
	$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 &copy; All rights reserved.', 'unikids' );

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

endif;

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

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

		$default_options = unikids_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;