<?php

// Fixed Trending Posts Options.
$wp_customize->add_section(
    'home_page_fixed_trending_options',
    array(
        'title' => __('Sitewide Fix Section', 'magfusion'),
        'panel' => 'general_options_panel',
    )
);
$wp_customize->add_setting(
    'magfusion_options[enable_fixed_trending]',
    array(
        'default' => $magfusion_default['enable_fixed_trending'],
        'sanitize_callback' => 'magfusion_sanitize_checkbox',
    )
);
$wp_customize->add_control(
    'magfusion_options[enable_fixed_trending]',
    array(
        'label' => __('Enable Fixed Trending', 'magfusion'),
        'section' => 'home_page_fixed_trending_options',
        'type' => 'checkbox',
    )
);



// Fixed Trending Posts Category.
$wp_customize->add_setting(
    'magfusion_options[fixed_trending_cat]',
    array(
        'default' => $magfusion_default['fixed_trending_cat'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    new Magfusion_Dropdown_Taxonomies_Control(
        $wp_customize,
        'magfusion_options[fixed_trending_cat]',
        array(
            'label' => __('Choose Fixed Trending category', 'magfusion'),
            'section' => 'home_page_fixed_trending_options',
        )
    )
);
// No of posts.
$wp_customize->add_setting(
    'magfusion_options[no_of_fixed_trending]',
    array(
        'default' => $magfusion_default['no_of_fixed_trending'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    'magfusion_options[no_of_fixed_trending]',
    array(
        'label' => __('Number of Posts', 'magfusion'),
        'section' => 'home_page_fixed_trending_options',
        'type' => 'number',
    )
);

// No of posts offset.
$wp_customize->add_setting(
    'magfusion_options[fixed_trending_number_of_post_offsets]',
    array(
        'default' => $magfusion_default['fixed_trending_number_of_post_offsets'],
        'sanitize_callback' => 'absint',
    )
);
$wp_customize->add_control(
    'magfusion_options[fixed_trending_number_of_post_offsets]',
    array(
        'label' => __('Post Offset Number', 'magfusion'),
        'section' => 'home_page_fixed_trending_options',
        'type' => 'number',
    )
);
// Posts Orderby.
$wp_customize->add_setting(
    'magfusion_options[fixed_trending_orderby]',
    array(
        'default' => $magfusion_default['fixed_trending_orderby'],
        'sanitize_callback' => 'magfusion_sanitize_select',
    )
);
$wp_customize->add_control(
    'magfusion_options[fixed_trending_orderby]',
    array(
        'label' => __('Orderby', 'magfusion'),
        'section' => 'home_page_fixed_trending_options',
        'type' => 'select',
        'choices' => array(
            'date' => __('Date', 'magfusion'),
            'id' => __('ID', 'magfusion'),
            'title' => __('Title', 'magfusion'),
            'rand' => __('Random', 'magfusion'),
        ),
    )
);
// Posts Order.
$wp_customize->add_setting(
    'magfusion_options[fixed_trending_order]',
    array(
        'default' => $magfusion_default['fixed_trending_order'],
        'sanitize_callback' => 'magfusion_sanitize_select',
    )
);
$wp_customize->add_control(
    'magfusion_options[fixed_trending_order]',
    array(
        'label' => __('Order', 'magfusion'),
        'section' => 'home_page_fixed_trending_options',
        'type' => 'select',
        'choices' => array(
            'asc' => __('ASC', 'magfusion'),
            'desc' => __('DESC', 'magfusion'),
        ),
    )
);