File: /var/www/html/site/newsite/wp-content/themes/ooze/inc/customizer/theme-options/single.php
<?php
$wp_customize->add_section(
'single_options' ,
array(
'title' => __( 'Single Options', 'ooze' ),
'panel' => 'ooze_option_panel',
)
);
/* Global Layout*/
$wp_customize->add_setting(
'ooze_options[single_sidebar_layout]',
array(
'default' => $default_options['single_sidebar_layout'],
'sanitize_callback' => 'ooze_sanitize_radio',
)
);
$wp_customize->add_control(
new Ooze_Radio_Image_Control(
$wp_customize,
'ooze_options[single_sidebar_layout]',
array(
'label' => __( 'Single Sidebar Layout', 'ooze' ),
'section' => 'single_options',
'choices' => ooze_get_general_layouts()
)
)
);
// Hide Side Bar on Mobile
$wp_customize->add_setting(
'ooze_options[hide_single_sidebar_mobile]',
array(
'default' => $default_options['hide_single_sidebar_mobile'],
'sanitize_callback' => 'ooze_sanitize_checkbox',
)
);
$wp_customize->add_control(
'ooze_options[hide_single_sidebar_mobile]',
array(
'label' => __( 'Hide Single Sidebar on Mobile', 'ooze' ),
'section' => 'single_options',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'ooze_section_seperator_single_1',
array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
new Ooze_Seperator_Control(
$wp_customize,
'ooze_section_seperator_single_1',
array(
'settings' => 'ooze_section_seperator_single_1',
'section' => 'single_options',
)
)
);
/* Post Meta */
$wp_customize->add_setting(
'ooze_options[single_post_meta]',
array(
'default' => $default_options['single_post_meta'],
'sanitize_callback' => 'ooze_sanitize_checkbox_multiple',
)
);
$wp_customize->add_control(
new Ooze_Checkbox_Multiple(
$wp_customize,
'ooze_options[single_post_meta]',
array(
'label' => __( 'Single Post Meta', 'ooze' ),
'description' => __( 'Choose the post meta you want to be displayed on post detail page', 'ooze' ),
'section' => 'single_options',
'choices' => array(
'author' => __( 'Author', 'ooze' ),
'date' => __( 'Date', 'ooze' ),
'comment' => __( 'Comment', 'ooze' ),
'category' => __( 'Category', 'ooze' ),
'tags' => __( 'Tags', 'ooze' ),
)
)
)
);
$wp_customize->add_setting(
'ooze_section_seperator_single_2',
array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
new Ooze_Seperator_Control(
$wp_customize,
'ooze_section_seperator_single_2',
array(
'settings' => 'ooze_section_seperator_single_2',
'section' => 'single_options',
)
)
);
/*Show Author Info Box
*-------------------------------*/
$wp_customize->add_setting(
'ooze_options[show_author_info]',
array(
'default' => $default_options['show_author_info'],
'sanitize_callback' => 'ooze_sanitize_checkbox',
)
);
$wp_customize->add_control(
'ooze_options[show_author_info]',
array(
'label' => __( 'Show Author Info Box', 'ooze' ),
'section' => 'single_options',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'ooze_section_seperator_single_3',
array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
new Ooze_Seperator_Control(
$wp_customize,
'ooze_section_seperator_single_3',
array(
'settings' => 'ooze_section_seperator_single_3',
'section' => 'single_options',
)
)
);
/*Show Related Posts
*-------------------------------*/
$wp_customize->add_setting(
'ooze_options[show_related_posts]',
array(
'default' => $default_options['show_related_posts'],
'sanitize_callback' => 'ooze_sanitize_checkbox',
)
);
$wp_customize->add_control(
'ooze_options[show_related_posts]',
array(
'label' => __( 'Show Related Posts', 'ooze' ),
'section' => 'single_options',
'type' => 'checkbox',
)
);
/*Related Posts Text.*/
$wp_customize->add_setting(
'ooze_options[related_posts_text]',
array(
'default' => $default_options['related_posts_text'],
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'ooze_options[related_posts_text]',
array(
'label' => __( 'Related Posts Text', 'ooze' ),
'section' => 'single_options',
'type' => 'text',
'active_callback' => 'ooze_is_related_posts_enabled',
)
);
/* Number of Related Posts */
$wp_customize->add_setting(
'ooze_options[no_of_related_posts]',
array(
'default' => $default_options['no_of_related_posts'],
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control(
'ooze_options[no_of_related_posts]',
array(
'label' => __( 'Number of Related Posts', 'ooze' ),
'section' => 'single_options',
'type' => 'number',
'active_callback' => 'ooze_is_related_posts_enabled',
)
);
/*Related Posts Orderby*/
$wp_customize->add_setting(
'ooze_options[related_posts_orderby]',
array(
'default' => $default_options['related_posts_orderby'],
'sanitize_callback' => 'ooze_sanitize_select',
)
);
$wp_customize->add_control(
'ooze_options[related_posts_orderby]',
array(
'label' => __( 'Orderby', 'ooze' ),
'section' => 'single_options',
'type' => 'select',
'choices' => array(
'date' => __('Date', 'ooze'),
'id' => __('ID', 'ooze'),
'title' => __('Title', 'ooze'),
'rand' => __('Random', 'ooze'),
),
'active_callback' => 'ooze_is_related_posts_enabled',
)
);
/*Related Posts Order*/
$wp_customize->add_setting(
'ooze_options[related_posts_order]',
array(
'default' => $default_options['related_posts_order'],
'sanitize_callback' => 'ooze_sanitize_select',
)
);
$wp_customize->add_control(
'ooze_options[related_posts_order]',
array(
'label' => __( 'Order', 'ooze' ),
'section' => 'single_options',
'type' => 'select',
'choices' => array(
'asc' => __('ASC', 'ooze'),
'desc' => __('DESC', 'ooze'),
),
'active_callback' => 'ooze_is_related_posts_enabled',
)
);
$wp_customize->add_setting(
'ooze_section_seperator_single_4',
array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
new Ooze_Seperator_Control(
$wp_customize,
'ooze_section_seperator_single_4',
array(
'settings' => 'ooze_section_seperator_single_4',
'section' => 'single_options',
)
)
);
/*Show Author Posts
*-----------------------------------------*/
$wp_customize->add_setting(
'ooze_options[show_author_posts]',
array(
'default' => $default_options['show_author_posts'],
'sanitize_callback' => 'ooze_sanitize_checkbox',
)
);
$wp_customize->add_control(
'ooze_options[show_author_posts]',
array(
'label' => __( 'Show Author Posts', 'ooze' ),
'section' => 'single_options',
'type' => 'checkbox',
)
);
/*Author Posts Text.*/
$wp_customize->add_setting(
'ooze_options[author_posts_text]',
array(
'default' => $default_options['author_posts_text'],
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'ooze_options[author_posts_text]',
array(
'label' => __( 'Author Posts Text', 'ooze' ),
'section' => 'single_options',
'type' => 'text',
'active_callback' => 'ooze_is_author_posts_enabled',
)
);
/* Number of Author Posts */
$wp_customize->add_setting(
'ooze_options[no_of_author_posts]',
array(
'default' => $default_options['no_of_author_posts'],
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control(
'ooze_options[no_of_author_posts]',
array(
'label' => __( 'Number of Author Posts', 'ooze' ),
'section' => 'single_options',
'type' => 'number',
'active_callback' => 'ooze_is_author_posts_enabled',
)
);
/*Author Posts Orderby*/
$wp_customize->add_setting(
'ooze_options[author_posts_orderby]',
array(
'default' => $default_options['author_posts_orderby'],
'sanitize_callback' => 'ooze_sanitize_select',
)
);
$wp_customize->add_control(
'ooze_options[author_posts_orderby]',
array(
'label' => __( 'Orderby', 'ooze' ),
'section' => 'single_options',
'type' => 'select',
'choices' => array(
'date' => __('Date', 'ooze'),
'id' => __('ID', 'ooze'),
'title' => __('Title', 'ooze'),
'rand' => __('Random', 'ooze'),
),
'active_callback' => 'ooze_is_author_posts_enabled',
)
);
/*Author Posts Order*/
$wp_customize->add_setting(
'ooze_options[author_posts_order]',
array(
'default' => $default_options['author_posts_order'],
'sanitize_callback' => 'ooze_sanitize_select',
)
);
$wp_customize->add_control(
'ooze_options[author_posts_order]',
array(
'label' => __( 'Order', 'ooze' ),
'section' => 'single_options',
'type' => 'select',
'choices' => array(
'asc' => __('ASC', 'ooze'),
'desc' => __('DESC', 'ooze'),
),
'active_callback' => 'ooze_is_author_posts_enabled',
)
);