<?php

/**
 * Blog List Settings
 *
 * @package Chic Lifestyle
 */
add_action( 'customize_register', 'chic_lifestyle_customize_blog_list_option' );
function chic_lifestyle_customize_blog_list_option(  $wp_customize  ) {
    $wp_customize->add_section( 'chic_lifestyle_blog_list_section', array(
        'title'       => esc_html__( 'Blog Options', 'chic-lifestyle' ),
        'description' => esc_html__( 'Customize Options on the Blog Page', 'chic-lifestyle' ),
        'panel'       => 'chic_lifestyle_general_panel',
        'priority'    => 5,
    ) );
    $wp_customize->add_setting( 'chic_lifestyle_post_details', array(
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'chic_lifestyle_sanitize_array',
        'default'           => array('date', 'categories', 'tags'),
    ) );
    $wp_customize->add_control( new Chic_Lifestyle_Multi_Check_Control($wp_customize, 'chic_lifestyle_post_details', array(
        'label'    => esc_html__( 'Hide / Show Details', 'chic-lifestyle' ),
        'section'  => 'chic_lifestyle_blog_list_section',
        'settings' => 'chic_lifestyle_post_details',
        'type'     => 'multi-check',
        'choices'  => array(
            'author'             => esc_html__( 'Show post author', 'chic-lifestyle' ),
            'date'               => esc_html__( 'Show post date', 'chic-lifestyle' ),
            'categories'         => esc_html__( 'Show Categories', 'chic-lifestyle' ),
            'tags'               => esc_html__( 'Show Tags', 'chic-lifestyle' ),
            'number_of_comments' => esc_html__( 'Show number of comments', 'chic-lifestyle' ),
        ),
    )) );
    $wp_customize->add_setting( 'chic_lifestyle_blog_view_upgrade_to_pro', array(
        'sanitize_callback' => null,
    ) );
    $wp_customize->add_control( new Chic_Lifestyle_Control_Upgrade_To_Pro($wp_customize, 'chic_lifestyle_blog_view_upgrade_to_pro', array(
        'section'     => 'chic_lifestyle_blog_list_section',
        'settings'    => 'chic_lifestyle_blog_view_upgrade_to_pro',
        'title'       => __( 'Choose how to arrange blog posts on the homepage.', 'chic-lifestyle' ),
        'items'       => array(
            'one' => array(
                'title' => __( 'Select from three different blog post layouts', 'chic-lifestyle' ),
            ),
        ),
        'button_url'  => esc_url( 'https://thebootstrapthemes.com/chic-lifestyle/#free-vs-pro' ),
        'button_text' => __( 'Upgrade Now', 'chic-lifestyle' ),
    )) );
}
