<?php
/**
 * Callbacks functions
 *
 * @package collarbiz
 */

if ( ! function_exists( 'collarbiz_slider_section_enable' ) ) :
	/**
	 * Check if slider_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_slider_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_slider]' )->value() ? true : false;
	}
endif;

if ( ! function_exists( 'collarbiz_introduction_section_enable' ) ) :
	/**
	 * Check if introduction_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_introduction_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_introduction]' )->value() ? true : false;
	}
endif;

if ( ! function_exists( 'collarbiz_service_section_enable' ) ) :
	/**
	 * Check if service_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_service_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_service]' )->value() ? true : false;
	}
endif;

if ( ! function_exists( 'collarbiz_skills_section_enable' ) ) :
	/**
	 * Check if skills_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_skills_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_skills]' )->value() ? true : false;
	}
endif;

if ( ! function_exists( 'collarbiz_features_section_enable' ) ) :
	/**
	 * Check if features_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_features_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_features]' )->value() ? true : false;
	}
endif;

if ( ! function_exists( 'collarbiz_recent_section_enable' ) ) :
	/**
	 * Check if recent_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_recent_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_recent]' )->value() ? true : false;
	}
endif;

if ( ! function_exists( 'collarbiz_recent_content_category_enable' ) ) :
	/**
	 * Check if recent content type is category.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_recent_content_category_enable( $control ) {
		return ( $control->manager->get_setting( 'collarbiz_theme_options[enable_recent]' )->value() && 'category' == $control->manager->get_setting( 'collarbiz_theme_options[recent_content_type]' )->value() );
	}
endif;

if ( ! function_exists( 'collarbiz_cta_section_enable' ) ) :
	/**
	 * Check if cta_section section enabled.
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 * @return bool Whether the control is active to the current preview.
	 */
	function collarbiz_cta_section_enable( $control ) {
		return $control->manager->get_setting( 'collarbiz_theme_options[enable_cta]' )->value() ? true : false;
	}
endif;
