<?php
$wp_customize->add_section(
    'single_author_options',
    array(
        'title' => esc_html__( 'Single Author Post Options', 'blogbull' ),
        'panel' => 'single_options_panel',
    )
);
/*Show Author Posts
*-----------------------------------------*/
$wp_customize->add_setting(
    'blogbull_options[show_author_posts]',
    array(
        'default'           => $blogbull_default['show_author_posts'],
        'sanitize_callback' => 'blogbull_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'blogbull_options[show_author_posts]',
    array(
        'label'    => __( 'Show Author Posts', 'blogbull' ),
        'section'  => 'single_author_options',
        'type'     => 'checkbox',
    )
);

/*Author Posts Text.*/
$wp_customize->add_setting(
    'blogbull_options[author_posts_text]',
    array(
        'default'           => $blogbull_default['author_posts_text'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'blogbull_options[author_posts_text]',
    array(
        'label'    => __( 'Author Posts Text', 'blogbull' ),
        'section'  => 'single_author_options',
        'type'     => 'text',
    )
);

/* Number of Author Posts */
$wp_customize->add_setting(
    'blogbull_options[no_of_author_posts]',
    array(
        'default'           => $blogbull_default['no_of_author_posts'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    'blogbull_options[no_of_author_posts]',
    array(
        'label'       => __( 'Number of Author Posts', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'number',
    )
);

/*Author Posts Orderby*/
$wp_customize->add_setting(
    'blogbull_options[author_posts_orderby]',
    array(
        'default'           => $blogbull_default['author_posts_orderby'],
        'sanitize_callback' => 'blogbull_sanitize_select',
    )
);
$wp_customize->add_control(
    'blogbull_options[author_posts_orderby]',
    array(
        'label'       => __( 'Orderby', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'select',
        'choices' => array(
            'date' => __('Date', 'blogbull'),
            'id' => __('ID', 'blogbull'),
            'title' => __('Title', 'blogbull'),
            'rand' => __('Random', 'blogbull'),
        ),
    )
);

/*Author Posts Order*/
$wp_customize->add_setting(
    'blogbull_options[author_posts_order]',
    array(
        'default'           => $blogbull_default['author_posts_order'],
        'sanitize_callback' => 'blogbull_sanitize_select',
    )
);
$wp_customize->add_control(
    'blogbull_options[author_posts_order]',
    array(
        'label'       => __( 'Order', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'select',
        'choices' => array(
            'asc' => __('ASC', 'blogbull'),
            'desc' => __('DESC', 'blogbull'),
        ),
    )
);



$wp_customize->add_setting(
    'blogbull_options[enable_author_posts_author_meta]',
    array(
        'default'           => $blogbull_default['enable_author_posts_author_meta'],
        'sanitize_callback' => 'blogbull_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'blogbull_options[enable_author_posts_author_meta]',
    array(
        'label'       => esc_html__( 'Show Author Meta', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'checkbox',
    )
);

$wp_customize->add_setting(
    'blogbull_options[select_author_posts_author_meta]',
    array(
        'default'           => $blogbull_default['select_author_posts_author_meta'],
        'sanitize_callback' => 'blogbull_sanitize_select',
    )
);
$wp_customize->add_control(
    'blogbull_options[select_author_posts_author_meta]',
    array(
        'label'         => esc_html__( 'Author Meta Display Options', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'select',
        'choices'       => blogbull_author_meta(),


    )
);

$wp_customize->add_setting(
    'blogbull_options[author_posts_author_meta_title]',
    array(
        'default'           => $blogbull_default['author_posts_author_meta_title'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'blogbull_options[author_posts_author_meta_title]',
    array(
        'label'    => __( 'Author Meta Text', 'blogbull' ),
        'section'  => 'single_author_options',
        'type'     => 'text',
    )
);

$wp_customize->add_setting(
    'blogbull_options[enable_author_posts_date_meta]',
    array(
        'default'           => $blogbull_default['enable_author_posts_date_meta'],
        'sanitize_callback' => 'blogbull_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'blogbull_options[enable_author_posts_date_meta]',
    array(
        'label'       => esc_html__( 'Display Published Date', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'checkbox',
    )
);

$wp_customize->add_setting(
    'blogbull_options[select_author_posts_date]',
    array(
        'default'           => $blogbull_default['select_author_posts_date'],
        'sanitize_callback' => 'blogbull_sanitize_select',
    )
);
$wp_customize->add_control(
    'blogbull_options[select_author_posts_date]',
    array(
        'label'         => esc_html__( 'Select Posted on Date Meta', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'select',
        'choices'       => blogbull_date_meta(),

    )
);

$wp_customize->add_setting(
    'blogbull_options[single_related_post_date_meta_title]',
    array(
        'default'           => $blogbull_default['single_related_post_date_meta_title'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'blogbull_options[single_related_post_date_meta_title]',
    array(
        'label'    => __( 'Date Text', 'blogbull' ),
        'section'  => 'single_author_options',
        'type'     => 'text',
    )
);

$wp_customize->add_setting(
    'blogbull_options[select_author_posts_date_format]',
    array(
        'default'           => $blogbull_default['select_author_posts_date_format'],
        'sanitize_callback' => 'blogbull_sanitize_select',
    )
);
$wp_customize->add_control(
    'blogbull_options[select_author_posts_date_format]',
    array(
        'label'         => esc_html__( 'Select Date Format', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'select',
        'choices'       => blogbull_get_date_formats(),
    )
);

$wp_customize->add_setting(
    'blogbull_options[enable_author_posts_category_meta]',
    array(
        'default'           => $blogbull_default['enable_author_posts_category_meta'],
        'sanitize_callback' => 'blogbull_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'blogbull_options[enable_author_posts_category_meta]',
    array(
        'label'       => esc_html__( 'Enable Category Meta', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'checkbox',
    )
);

$wp_customize->add_setting(
    'blogbull_options[select_author_posts_number_of_category]',
    array(
        'default'           => $blogbull_default['select_author_posts_number_of_category'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    'blogbull_options[select_author_posts_number_of_category]',
    array(
        'label'       => __( 'Number of Category', 'blogbull' ),
        'section'     => 'single_related_options',
        'type'        => 'number',
    )
);

$wp_customize->add_setting(
    'blogbull_options[author_posts_category_label]',
    array(
        'default'           => $blogbull_default['author_posts_category_label'],
        'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control(
    'blogbull_options[author_posts_category_label]',
    array(
        'label'    => __( 'Category Label', 'blogbull' ),
        'section'  => 'single_author_options',
        'type'     => 'text',
    )
);

$wp_customize->add_setting(
    'blogbull_options[select_author_posts_category_color]',
    array(
        'default'           => $blogbull_default['select_author_posts_category_color'],
        'sanitize_callback' => 'blogbull_sanitize_select',
    )
);
$wp_customize->add_control(
    'blogbull_options[select_author_posts_category_color]',
    array(
        'label'         => esc_html__( 'Select Category Color', 'blogbull' ),
        'section'     => 'single_author_options',
        'type'        => 'select',
        'choices'       => blogbull_category_color(),

    )
);
