<?php
/**
 * Customizer active callbacks
 *
 * @package Theme Palace
 * @subpackage FavBlog
 * @since FavBlog 1.0.0
 */


if ( ! function_exists( 'favblog_is_breadcrumb_enable' ) ) :
	/**
	 * Check if breadcrumb is enabled.
	 *
	 * @since FavBlog 1.0.0
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function favblog_is_breadcrumb_enable( $control ) {
		return $control->manager->get_setting( 'favblog_theme_options[breadcrumb_enable]' )->value();
	}
endif;

if ( ! function_exists( 'favblog_is_pagination_enable' ) ) :
	/**
	 * Check if pagination is enabled.
	 *
	 * @since FavBlog 1.0.0
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function favblog_is_pagination_enable( $control ) {
		return $control->manager->get_setting( 'favblog_theme_options[pagination_enable]' )->value();
	}
endif;


if ( ! function_exists( 'favblog_is_static_homepage_enable' ) ) :
	/**
	 * Check if static homepage is enabled.
	 *
	 * @since FavBlog 1.0.0
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function favblog_is_static_homepage_enable( $control ) {
		return ( 'page' == $control->manager->get_setting( 'show_on_front' )->value() );
	}
endif;

/**
 * Front Page Active Callbacks
 */

/**
 * Check if secondary nav section is enabled.
 *
 * @since FavBlog 1.0.0
 * @param WP_Customize_Control $control WP_Customize_Control instance.
 * @return bool Whether the control is active to the current preview.
 */
function favblog_is_topbar_section_enable( $control ) {
	return ( $control->manager->get_setting( 'favblog_theme_options[topbar_section_enable]' )->value() );
}


/*hero_section section*/

/**
 * Check if hero_section section is enabled.
 *
 * @since FavBlog 1.0.0
 * @param WP_Customize_Control $control WP_Customize_Control instance.
 * @return bool Whether the control is active to the current preview.
 */
function favblog_is_hero_section_enable( $control ) {
	return ( $control->manager->get_setting( 'favblog_theme_options[hero_section_enable]' )->value() );
}


/*popular_post section*/

/**
 * Check if popular_post section is enabled.
 *
 * @since FavBlog 1.0.0
 * @param WP_Customize_Control $control WP_Customize_Control instance.
 * @return bool Whether the control is active to the current preview.
 */
function favblog_is_popular_post_section_enable( $control ) {
	return ( $control->manager->get_setting( 'favblog_theme_options[popular_post_section_enable]' )->value() );
}

/*recent_post section*/

/**
 * Check if recent_post section is enabled.
 *
 * @since FavBlog 1.0.0
 * @param WP_Customize_Control $control WP_Customize_Control instance.
 * @return bool Whether the control is active to the current preview.
 */
function favblog_is_recent_post_section_enable( $control ) {
	return ( $control->manager->get_setting( 'favblog_theme_options[recent_post_section_enable]' )->value() );
}

/*most_read section*/

/**
 * Check if most_read section is enabled.
 *
 * @since FavBlog 1.0.0
 * @param WP_Customize_Control $control WP_Customize_Control instance.
 * @return bool Whether the control is active to the current preview.
 */
function favblog_is_most_read_section_enable( $control ) {
	return ( $control->manager->get_setting( 'favblog_theme_options[most_read_section_enable]' )->value() );
}

