<?php
/**
 * Default theme options.
 *
 * @package Rock Singer
 */

if ( ! function_exists( 'rock_singer_get_default_theme_options' ) ) :

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

	$defaults = array();

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

	// Slider Section	
	$defaults['enable_featured_slider_section']		= false;
	$defaults['number_of_featured_slider_items']	= 3;
	$defaults['data_slick_speed']					= 500;
	$defaults['data_slick_fade']					= 0;
	$defaults['data_slick_infinite']				= 0;
	$defaults['data_slick_autoplay']				= 0;
	$defaults['data_slick_draggable']				= 1;

	// About Us Section	
	$defaults['enable_about_us_section']			= false;
	$defaults['about_us_subtitle']					= esc_html__( 'Biography', 'rock-singer' );
	$defaults['about_us_section_title']				= esc_html__( 'Connecting creative minds', 'rock-singer' );
	$defaults['about_us_content']					= esc_html__( 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which dont look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there is not anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet.', 'rock-singer' );
	$defaults['about_us_btn_label']					= esc_html__( 'Read More', 'rock-singer' );

	// Upcoming Events Section	
	$defaults['enable_upcoming_events_section']			= false;
	$defaults['upcoming_events_background_image']	    = get_template_directory_uri() .'/assets/images/event-bg.jpg';
	$defaults['upcoming_events_section_subtitle']		= esc_html__( 'Upcoming Events', 'rock-singer' );
	$defaults['upcoming_events_section_title']			= esc_html__( 'Follow our amazing shows', 'rock-singer' );
	$defaults['number_of_upcoming_events_items']		= 5;

	// Our Gallery Section	
	$defaults['enable_our_gallery_section']			= false;
	$defaults['our_gallery_section_subtitle']		= esc_html__( 'Latest Galleries', 'rock-singer' );
	$defaults['our_gallery_section_title']			= esc_html__( 'Music is like a dream', 'rock-singer' );
	$defaults['number_of_our_gallery_items']		= 6;

	// Call to action Section	
	$defaults['enable_call_to_action_section']	   	= false;
	$defaults['call_to_action_title']	   	 		= esc_html__( 'Follow us on Instagram', 'rock-singer' );
	$defaults['call_to_action_button_label']	   	= esc_html__( 'Follow Us', 'rock-singer' );
	$defaults['call_to_action_button_url']	   	 	= '#';

	// Latest Posts Section
	$defaults['enable_blog_section']		= false;
	$defaults['blog_section_subtitle']		= esc_html__( 'Latest News', 'rock-singer' );
	$defaults['blog_section_title']			= esc_html__( 'See what’s happenning around the world of music', 'rock-singer' );
	$defaults['blog_category']	   			= 0; 
	$defaults['blog_number']				= 3;

	//General Section
	$defaults['your_latest_posts_title']			= esc_html__('Blog','rock-singer');
	$defaults['excerpt_length']						= 20;
	$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 2024 Rock Singer | All Rights Reserved.', 'rock-singer' );

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

endif;

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

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

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