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

if ( ! function_exists( 'rock_studio_get_default_theme_options' ) ) :

	/**
	 * Get default theme options.
	 *
	 * @since 1.0.0
	 *
	 * @return array Default theme options.
	 */
function rock_studio_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']					= 1000;
	$defaults['data_slick_fade']					= 0;
	$defaults['data_slick_infinite']				= 0;
	$defaults['data_slick_autoplay']				= 0;
	$defaults['data_slick_draggable']				= 1;

	// Albums Section	
	$defaults['enable_featured_albums_section']			= false;
	$defaults['featured_albums_section_title']			= esc_html__( 'Latest Albums', 'rock-studio' );
	$defaults['featured_albums_section_subtitle']		= esc_html__( 'Live performances account for more than 40 percent of their income, while profits from streaming and record sales amount to only 5 percent of their earnings.', 'rock-studio' );
	$defaults['number_of_featured_albums_items']		= 3;

	// Team Section	
	$defaults['enable_our_team_section']			= false;
	$defaults['our_team_section_title']				= esc_html__( 'Band Members', 'rock-studio' );
	$defaults['our_team_section_subtitle']			= esc_html__( 'Live performances account for more than 40 percent of their income, while profits from streaming and record sales amount to only 5 percent of their earnings.', 'rock-studio' );
	$defaults['number_of_our_team_items']			= 6;

	// Upcoming Events Section	
	$defaults['enable_upcoming_events_section']			= false;
	$defaults['upcoming_events_section_title']			= esc_html__( 'Upcoming Events', 'rock-studio' );
	$defaults['upcoming_events_section_subtitle']		= esc_html__( 'Live performances account for more than 40 percent of their income, while profits from streaming and record sales amount to only 5 percent of their earnings.', 'rock-studio' );
	$defaults['number_of_upcoming_events_items']		= 5;

	// Our Gallery Section	
	$defaults['enable_our_gallery_section']			= false;
	$defaults['our_gallery_section_title']			= esc_html__( 'Latest Galleries', 'rock-studio' );
	$defaults['our_gallery_section_subtitle']		= esc_html__( 'Live performances account for more than 40 percent of their income, while profits from streaming and record sales amount to only 5 percent of their earnings.', 'rock-studio' );
	$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__( 'Amazing Discount On Tickets', 'rock-studio' );
	$defaults['call_to_action_button_label']	   	= esc_html__( 'Buy Ticket Now', 'rock-studio' );
	$defaults['call_to_action_button_url']	   	 	= '#';

	// Latest Posts Section
	$defaults['enable_blog_section']		= false;
	$defaults['blog_section_title']			= esc_html__( 'Interesting News', 'rock-studio' );
	$defaults['blog_section_subtitle']		= esc_html__( 'Live performances account for more than 40 percent of their income, while profits from streaming and record sales amount to only 5 percent of their earnings.', 'rock-studio' );
	$defaults['blog_category']	   			= 0; 
	$defaults['blog_number']				= 3;

	//General Section
	$defaults['your_latest_posts_title']			= esc_html__('Blog','rock-studio');
	$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 2023 Rock Studio | All Rights Reserved.', 'rock-studio' );

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

endif;

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

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

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