<?php

/**
 * Active Callbacks
 *
 * @package Cosmic Blog
 */

// Theme Options.
function cosmic_blog_is_pagination_enabled( $control ) {
	return ( $control->manager->get_setting( 'cosmic_blog_enable_pagination' )->value() );
}
function cosmic_blog_is_breadcrumb_enabled( $control ) {
	return ( $control->manager->get_setting( 'cosmic_blog_enable_breadcrumb' )->value() );
}

// Banner Section.
function cosmic_blog_is_banner_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'cosmic_blog_enable_banner_section' )->value() );
}
// Banner Slider Section.
function cosmic_blog_is_banner_slider_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'cosmic_blog_banner_slider_content_type' )->value();
	return ( cosmic_blog_is_banner_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function cosmic_blog_is_banner_slider_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'cosmic_blog_banner_slider_content_type' )->value();
	return ( cosmic_blog_is_banner_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// Tile Grid Posts Section.
function cosmic_blog_is_tile_grid_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'cosmic_blog_enable_tile_grid_section' )->value() );
}
function cosmic_blog_is_tile_grid_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'cosmic_blog_tile_grid_content_type' )->value();
	return ( cosmic_blog_is_tile_grid_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function cosmic_blog_is_tile_grid_section_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'cosmic_blog_tile_grid_content_type' )->value();
	return ( cosmic_blog_is_tile_grid_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// Check if static home page is enabled.
function cosmic_blog_is_static_homepage_enabled( $control ) {
	return ( 'page' === $control->manager->get_setting( 'show_on_front' )->value() );
}
