<?php
// Tags Posts Options.
$wp_customize->add_section(
	'home_page_tags_options',
	array(
		'title' => __( 'Tagged Section', 'newsmass' ),
		'panel' => 'front_page_theme_options_panel',
	)
);

$wp_customize->add_setting(
    'newsmass_options[enable_tags]',
    array(
        'default'           => $newsmass_default['enable_tags'],
        'sanitize_callback' => 'newsmass_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmass_options[enable_tags]',
    array(
		'label'    => __( 'Enable Tags', 'newsmass' ),
        'section'     => 'home_page_tags_options',
        'type'        => 'checkbox',
    )
);

$wp_customize->add_setting(
    'newsmass_options[enable_tags_label]',
    array(
        'default'           => $newsmass_default['enable_tags_label'],
        'sanitize_callback' => 'newsmass_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmass_options[enable_tags_label]',
    array(
		'label'           => __( 'Enable Tags Label', 'newsmass' ),
        'section'     => 'home_page_tags_options',
        'type'        => 'checkbox',
    )
);

// Tags Label Style.
$wp_customize->add_setting(
    'newsmass_options[tags_label_style]',
    array(
        'default'           => $newsmass_default['tags_label_style'],
        'sanitize_callback' => 'newsmass_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmass_options[tags_label_style]',
    array(
        'label'           => __( 'Label Style', 'newsmass' ),
        'section'         => 'home_page_tags_options',
        'type'            => 'select',
        'choices'         => array(
            'style_1' => __( 'Plain', 'newsmass' ),
            'style_2' => __( 'With Icon', 'newsmass' ),
        ),
    )
);


// Tags Label Text.
$wp_customize->add_setting(
    'newsmass_options[tags_label_text]',
    array(
        'default'           => $newsmass_default['tags_label_text'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'newsmass_options[tags_label_text]',
    array(
        'label'           => __( 'Tags Label Text', 'newsmass' ),
        'description'     => __( 'Leave empty if you want it blank', 'newsmass' ),
        'section'         => 'home_page_tags_options',
        'type'            => 'text',
    )
);

// No of posts.
$wp_customize->add_setting(
    'newsmass_options[no_of_tags]',
    array(
        'default'           => $newsmass_default['no_of_tags'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    'newsmass_options[no_of_tags]',
    array(
		'label'           => __( 'Number of Tags', 'newsmass' ),
		'section'         => 'home_page_tags_options',
		'type'            => 'number',
    )
);


// Posts Orderby.
$wp_customize->add_setting(
    'newsmass_options[tags_orderby]',
    array(
        'default'           => $newsmass_default['tags_orderby'],
        'sanitize_callback' => 'newsmass_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmass_options[tags_orderby]',
    array(
		'label'           => __( 'Orderby', 'newsmass' ),
		'section'         => 'home_page_tags_options',
		'type'            => 'select',
		'choices'         => array(
			'date'  => __( 'Date', 'newsmass' ),
			'id'    => __( 'ID', 'newsmass' ),
			'title' => __( 'Title', 'newsmass' ),
			'rand'  => __( 'Random', 'newsmass' ),
		),
    )
);


// Posts Order.
$wp_customize->add_setting(
    'newsmass_options[tags_order]',
    array(
        'default'           => $newsmass_default['tags_order'],
        'sanitize_callback' => 'newsmass_sanitize_select',
    )
);
$wp_customize->add_control(
    'newsmass_options[tags_order]',
    array(
		'label'           => __( 'Orderby', 'newsmass' ),
		'section'         => 'home_page_tags_options',
		'type'            => 'select',
		'choices'         => array(
			'asc'  => __( 'ASC', 'newsmass' ),
			'desc' => __( 'DESC', 'newsmass' ),
		),
    )
);


$wp_customize->add_setting(
    'newsmass_options[hide_tags_label_responsive]',
    array(
        'default'           => $newsmass_default['hide_tags_label_responsive'],
        'sanitize_callback' => 'newsmass_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'newsmass_options[hide_tags_label_responsive]',
    array(
		'label'           => __( 'Hide Label on Responsive', 'newsmass' ),
        'section'     => 'home_page_tags_options',
        'type'        => 'checkbox',
    )
);