<?php
/**
 * Theme Options.
 *
 * @package blogging_hub
 */

//-------------------------------------------------------//

// ===============================
// Most Popular Review Section
// ===============================
$wp_customize->add_section('blogging_hub_popular_review_section', array(
    'title'       => __('Most Popular Review', 'blogging-hub'),
    'priority'    => 200,
    'panel'       => 'home_option_panel',
));

// SHOW / HIDE
$wp_customize->add_setting('blogging_hub_popular_review_hide', array(
    'default' => false,
    'sanitize_callback' => 'blogging_hub_sanitize_checkbox',
));
$wp_customize->add_control('blogging_hub_popular_review_hide', array(
    'section' => 'blogging_hub_popular_review_section',
    'label'   => __('Enable Section', 'blogging-hub'),
    'type'    => 'checkbox',
));

// TITLE
$wp_customize->add_setting('blogging_hub_popular_review_title', array(
    'default' => '',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('blogging_hub_popular_review_title', array(
    'section' => 'blogging_hub_popular_review_section',
    'label'   => __('Section Title', 'blogging-hub'),
    'type'    => 'text',
));

// View All Button Text
$wp_customize->add_setting('blogging_hub_popular_review_view_all_btn', array(
    'default' => '',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('blogging_hub_popular_review_view_all_btn', array(
    'label'   => __('View All Button Text', 'blogging-hub'),
    'section' => 'blogging_hub_popular_review_section',
    'type'    => 'text',
));


// POST COUNT
$wp_customize->add_setting('blogging_hub_popular_review_count', array(
    'default' => 4,
    'sanitize_callback' => 'absint',
));
$wp_customize->add_control('blogging_hub_popular_review_count', array(
    'label'   => __('Number of Posts', 'blogging-hub'),
    'section' => 'blogging_hub_popular_review_section',
    'type'    => 'number',
));




// ===============================
// Categories Section
// ===============================
$wp_customize->add_section('blogging_hub_categories_section', array(
    'title'    => __('Categories Section', 'blogging-hub'),
    'priority' => 96,
    'panel'    => 'home_option_panel',
));

// Show/Hide
$wp_customize->add_setting('blogging_hub_categories_hide', array(
    'default' => false,
    'sanitize_callback' => 'blogging_hub_sanitize_checkbox',
));

$wp_customize->add_control('blogging_hub_categories_hide', array(
    'label'   => __('Enable Categories Section', 'blogging-hub'),
    'section' => 'blogging_hub_categories_section',
    'type'    => 'checkbox',
));

// TITLE
$wp_customize->add_setting('blogging_hub_categories_title', array(
    'default' => '',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('blogging_hub_categories_title', array(
    'section' => 'blogging_hub_categories_section',
    'label'   => __('Section Title', 'blogging-hub'),
    'type'    => 'text',
));

// Count
$wp_customize->add_setting('blogging_hub_categories_count', array(
    'default' => 4,
    'sanitize_callback' => 'absint',
));

$wp_customize->add_control('blogging_hub_categories_count', array(
    'label'   => __('Number of Categories', 'blogging-hub'),
    'section' => 'blogging_hub_categories_section',
    'type'    => 'number',
));




// ================= HERO SECTION =================
$wp_customize->add_section('blogging_hub_blog_hero_section', array(
    'title' => __('Blog Hero Section', 'blogging-hub'),
    'panel' => 'home_option_panel',
));

// Show/Hide
$wp_customize->add_setting('blogging_hub_blog_hero_hide', array(
    'default' => false,
    'sanitize_callback' => 'blogging_hub_sanitize_checkbox',
));

$wp_customize->add_control('blogging_hub_blog_hero_hide', array(
    'label' => __('Enable Hero Section', 'blogging-hub'),
    'section' => 'blogging_hub_blog_hero_section',
    'type' => 'checkbox',
));

// CATEGORY SELECT
$wp_customize->add_setting('blogging_hub_blog_hero_count_category', array(
    'default' => '',
    'sanitize_callback' => 'absint',
));
$wp_customize->add_control('blogging_hub_blog_hero_count_category', array(
    'label'   => __('Select Category', 'blogging-hub'),
    'section' => 'blogging_hub_blog_hero_section',
    'type'    => 'select',
    'choices' => blogging_hub_get_categories(),
));

// Post Count
$wp_customize->add_setting('blogging_hub_blog_hero_count', array(
    'default' => 3,
    'sanitize_callback' => 'absint',
));

$wp_customize->add_control('blogging_hub_blog_hero_count', array(
    'label' => __('Slider Posts Count', 'blogging-hub'),
    'section' => 'blogging_hub_blog_hero_section',
    'type' => 'number',
));

// TITLE
$wp_customize->add_setting('blogging_hub_trending_title', array(
    'default' => '',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('blogging_hub_trending_title', array(
    'section' => 'blogging_hub_blog_hero_section',
    'label'   => __('Right Section Title', 'blogging-hub'),
    'type'    => 'text',
));