add_section('blogarc_search_post_section', array( 'title' => __('Search Options', 'blogarc'), 'capability' => 'edit_theme_options', 'panel' => 'theme_option_panel', 'priority' => 5, )); $wp_customize->add_setting('blogarc_enable_post_search', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean', )); $wp_customize->add_control('blogarc_enable_post_search', array( 'label' => __('Enable Post On Search', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('blogarc_custom_title', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('blogarc_custom_title', array( 'label' => __('Section Post Title', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('blogarc_number_of_posts', array( 'default' => 4, 'sanitize_callback' => 'absint', )); $wp_customize->add_control('blogarc_number_of_posts', array( 'label' => __('Number of Posts', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 8, ), )); $wp_customize->add_setting('blogarc_select_category', array( 'default' => '', 'sanitize_callback' => 'absint', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'blogarc_select_category', array( 'label' => __('Select Post Category', 'blogarc'), 'section' => 'blogarc_search_post_section', 'settings' => 'blogarc_select_category', 'type' => 'select', 'choices' => blogarc_get_category_choices(), ))); $wp_customize->add_setting('enable_search_author_meta', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean', )); $wp_customize->add_control('enable_search_author_meta', array( 'label' => __('Enable Meta Author', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('select_search_author_meta', array( 'default' => 'with_icon', 'sanitize_callback' => 'blogarc_sanitize_author_meta', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_author_meta', array( 'label' => __('Select Author Meta', 'blogarc'), 'section' => 'blogarc_search_post_section', 'settings' => 'select_search_author_meta', 'type' => 'select', 'choices' => array( 'with_label' => __( 'With Label', 'blogarc' ), 'with_icon' => __( 'With Icon', 'blogarc' ), 'with_avatar_image' => __( 'With Avatar Image', 'blogarc' ), ), ))); $wp_customize->add_setting('search_author_meta_label', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('search_author_meta_label', array( 'label' => __('Author Label', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('enable_search_date_meta', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean', )); $wp_customize->add_control('enable_search_date_meta', array( 'label' => __('Enable Search Meta Date', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('select_search_date_meta', array( 'default' => 'with_icon', 'sanitize_callback' => 'blogarc_sanitize_author_meta', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_date_meta', array( 'label' => __('Select Date Meta', 'blogarc'), 'section' => 'blogarc_search_post_section', 'settings' => 'select_search_date_meta', 'type' => 'select', 'choices' => array( 'with_label' => __( 'With Label', 'blogarc' ), 'with_icon' => __( 'With Icon', 'blogarc' ), ), ))); $wp_customize->add_setting('search_date_meta_label', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('search_date_meta_label', array( 'label' => __('Date Label', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('select_search_date_format', array( 'default' => 'classic', 'sanitize_callback' => 'blogarc_sanitize_date_meta', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_date_format', array( 'label' => __('Select Date Meta', 'blogarc'), 'section' => 'blogarc_search_post_section', 'settings' => 'select_search_date_format', 'type' => 'select', 'choices' => array( 'classic' => __( 'Classic', 'blogarc' ), 'time_ago' => __( 'Time Ago', 'blogarc' ), ), ))); $wp_customize->add_setting('enable_search_meta_category', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean', )); $wp_customize->add_control('enable_search_meta_category', array( 'label' => __('Enable Single Meta Category', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('search_category_number', array( 'default' => '2', 'sanitize_callback' => 'absint', )); $wp_customize->add_control('search_category_number', array( 'label' => __('Select Category Display Limit', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'number', )); $wp_customize->add_setting('search_category_label', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('search_category_label', array( 'label' => __('Category Label', 'blogarc'), 'section' => 'blogarc_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('select_search_category_color_style', array( 'default' => 'none', 'sanitize_callback' => 'blogarc_sanitize_category_color', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_category_color_style', array( 'label' => __('Select Category Meta', 'blogarc'), 'section' => 'blogarc_search_post_section', 'settings' => 'select_search_category_color_style', 'type' => 'select', 'choices' => array( 'none' => __( 'None', 'blogarc' ), 'has-background' => __( 'Has background', 'blogarc' ), 'has-text-color' => __( 'Has text color', 'blogarc' ), ), )));