<?php
/**
* Posts Settings.
*
* @package NewsNation
*/

$newsnation_default = newsnation_get_default_theme_options();

// Single Post Section.
$wp_customize->add_section( 'posts_settings',
	array(
	'title'      => esc_html__( 'Article Meta Settings', 'newsnation' ),
	'priority'   => 35,
	'capability' => 'edit_theme_options',
	'panel'      => 'theme_option_panel',
	)
);

$wp_customize->add_setting('ed_post_date',
    array(
        'default' => $newsnation_default['ed_post_date'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_post_date',
    array(
        'label' => esc_html__('Enable Posts Date', 'newsnation'),
        'section' => 'posts_settings',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('ed_post_author',
    array(
        'default' => $newsnation_default['ed_post_author'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_post_author',
    array(
        'label' => esc_html__('Enable Posts Author', 'newsnation'),
        'section' => 'posts_settings',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('ed_post_category',
    array(
        'default' => $newsnation_default['ed_post_category'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_post_category',
    array(
        'label' => esc_html__('Enable Posts Category', 'newsnation'),
        'section' => 'posts_settings',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('ed_post_tags',
    array(
        'default' => $newsnation_default['ed_post_tags'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_post_tags',
    array(
        'label' => esc_html__('Enable Posts Tags', 'newsnation'),
        'section' => 'posts_settings',
        'type' => 'checkbox',
    )
);


// Enable Disable Post.
$wp_customize->add_setting('post_date_format',
    array(
        'default' => $newsnation_default['post_date_format'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'newsnation_sanitize_select',
    )
);
$wp_customize->add_control('post_date_format',
    array(
        'label' => esc_html__('Posted Date Format', 'newsnation'),
        'section' => 'posts_settings',
        'type' => 'select',
        'choices'               => array(
            'default' => esc_html__( 'Apply Default Format', 'newsnation' ),
            'time-ago' => esc_html__( 'Apply Time Age Format', 'newsnation' ),
            ),
        )
);