<?php
/**
 * Default theme options.
 *
 * @package Mavix Cafe
 */

if ( ! function_exists( 'mavix_cafe_get_default_theme_options' ) ) :

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

	$mavix_cafe_defaults = array();

	// Contact Details
	$mavix_cafe_defaults['mavix_cafe_show_contact_details'] 		= true;
	$mavix_cafe_defaults['mavix_cafe_address_one']				= esc_html__('214 West Arnold St','mavix-cafe');
	$mavix_cafe_defaults['mavix_cafe_address_two']				= esc_html__('New York, NY 10002','mavix-cafe');
	$mavix_cafe_defaults['mavix_cafe_phone_number']				= esc_html__('(007) 123 456 7890','mavix-cafe');
	$mavix_cafe_defaults['mavix_cafe_opening_time']				= esc_html__('Mon-Fri 10:00am-7:30pm','mavix-cafe');
	$mavix_cafe_defaults['mavix_cafe_email_id']					= esc_html__('info@example.com','mavix-cafe');
	$mavix_cafe_defaults['mavix_cafe_support_text']				= esc_html__('24 X 7 online support','mavix-cafe');

	// Menu
	$mavix_cafe_defaults['mavix_cafe_show_menu_button'] 			= true;
	$mavix_cafe_defaults['mavix_cafe_menu_button_text']			= esc_html__('Book A Table','mavix-cafe');
	$mavix_cafe_defaults['mavix_cafe_menu_button_url']			= esc_url('#','mavix-cafe');

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

	//Footer section 		
	$mavix_cafe_defaults['copyright_text']					= esc_html__( 'Copyright &copy; All rights reserved.', 'mavix-cafe' );

	// Pass through filter.
	$mavix_cafe_defaults = apply_filters( 'mavix_cafe_filter_default_theme_options', $mavix_cafe_defaults );
	return $mavix_cafe_defaults;
}

endif;

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

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

		$mavix_cafe_default_options = mavix_cafe_get_default_theme_options();
		if ( empty( $key ) ) {
			return;
		}

		$mavix_cafe_theme_options = (array)get_theme_mod( 'theme_options' );
		$mavix_cafe_theme_options = wp_parse_args( $mavix_cafe_theme_options, $mavix_cafe_default_options );

		$value = null;

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

		return $value;

	}

endif;