<?php

/**
 * Active Callbacks
 *
 * @package Majestic Blog
 */

// Theme Options.
function majestic_blog_is_pagination_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_pagination' )->value() );
}
function majestic_blog_is_breadcrumb_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_breadcrumb' )->value() );
}

// Topbar Section.
function majestic_blog_is_topbar_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_topbar' )->value() );
}

// Flash Article Section.
function majestic_blog_is_flash_articles_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_flash_articles_section' )->value() );
}
function majestic_blog_is_flash_articles_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_flash_articles_content_type' )->value();
	return ( majestic_blog_is_flash_articles_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function majestic_blog_is_flash_articles_section_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_flash_articles_content_type' )->value();
	return ( majestic_blog_is_flash_articles_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// Banner Section.
function majestic_blog_is_banner_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_banner_section' )->value() );
}
// Banner Slider Section.
function majestic_blog_is_banner_slider_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_banner_slider_content_type' )->value();
	return ( majestic_blog_is_banner_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function majestic_blog_is_banner_slider_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_banner_slider_content_type' )->value();
	return ( majestic_blog_is_banner_section_enabled( $control ) && ( 'category' === $content_type ) );
}
// Banner Editor Choice Section.
function majestic_blog_is_banner_editor_choice_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_banner_editor_choice_content_type' )->value();
	return ( majestic_blog_is_banner_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function majestic_blog_is_banner_editor_choice_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_banner_editor_choice_content_type' )->value();
	return ( majestic_blog_is_banner_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// Categories Section.
function majestic_blog_is_categories_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_categories_section' )->value() );
}

// Tile Posts Section.
function majestic_blog_is_tile_posts_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_tile_posts_section' )->value() );
}
function majestic_blog_is_tile_posts_section_and_content_type_post_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_tile_posts_content_type' )->value();
	return ( majestic_blog_is_tile_posts_section_enabled( $control ) && ( 'post' === $content_type ) );
}
function majestic_blog_is_tile_posts_section_and_content_type_category_enabled( $control ) {
	$content_type = $control->manager->get_setting( 'majestic_blog_tile_posts_content_type' )->value();
	return ( majestic_blog_is_tile_posts_section_enabled( $control ) && ( 'category' === $content_type ) );
}

// Advertisement section.
function majestic_blog_is_advertisement_section_enabled( $control ) {
	return ( $control->manager->get_setting( 'majestic_blog_enable_advertisement_section' )->value() );
}

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