add_section('blogbend_search_post_section', array( 'title' => __('Search Options', 'blogbend'), 'capability' => 'edit_theme_options', 'panel' => 'theme_option_panel', 'priority' => 5, )); $wp_customize->add_setting('blogbend_enable_post_search', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean', )); $wp_customize->add_control('blogbend_enable_post_search', array( 'label' => __('Enable Post On Search', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('blogbend_custom_title', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('blogbend_custom_title', array( 'label' => __('Section Post Title', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('blogbend_number_of_posts', array( 'default' => 4, 'sanitize_callback' => 'absint', )); $wp_customize->add_control('blogbend_number_of_posts', array( 'label' => __('Number of Posts', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'number', 'input_attrs' => array( 'min' => 1, 'max' => 8, ), )); $wp_customize->add_setting('blogbend_select_category', array( 'default' => '', 'sanitize_callback' => 'absint', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'blogbend_select_category', array( 'label' => __('Select Post Category', 'blogbend'), 'section' => 'blogbend_search_post_section', 'settings' => 'blogbend_select_category', 'type' => 'select', 'choices' => blogbend_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', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('select_search_author_meta', array( 'default' => 'with_icon', 'sanitize_callback' => 'blogbend_sanitize_author_meta', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_author_meta', array( 'label' => __('Select Author Meta', 'blogbend'), 'section' => 'blogbend_search_post_section', 'settings' => 'select_search_author_meta', 'type' => 'select', 'choices' => array( 'with_label' => __( 'With Label', 'blogbend' ), 'with_icon' => __( 'With Icon', 'blogbend' ), 'with_avatar_image' => __( 'With Avatar Image', 'blogbend' ), ), ))); $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', 'blogbend'), 'section' => 'blogbend_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', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'checkbox', )); $wp_customize->add_setting('select_search_date_meta', array( 'default' => 'with_icon', 'sanitize_callback' => 'blogbend_sanitize_author_meta', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_date_meta', array( 'label' => __('Select Date Meta', 'blogbend'), 'section' => 'blogbend_search_post_section', 'settings' => 'select_search_date_meta', 'type' => 'select', 'choices' => array( 'with_label' => __( 'With Label', 'blogbend' ), 'with_icon' => __( 'With Icon', 'blogbend' ), ), ))); $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', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('select_search_date_format', array( 'default' => 'classic', 'sanitize_callback' => 'blogbend_sanitize_date_meta', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_date_format', array( 'label' => __('Select Date Meta', 'blogbend'), 'section' => 'blogbend_search_post_section', 'settings' => 'select_search_date_format', 'type' => 'select', 'choices' => array( 'classic' => __( 'Classic', 'blogbend' ), 'time_ago' => __( 'Time Ago', 'blogbend' ), ), ))); $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', 'blogbend'), 'section' => 'blogbend_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', 'blogbend'), 'section' => 'blogbend_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', 'blogbend'), 'section' => 'blogbend_search_post_section', 'type' => 'text', )); $wp_customize->add_setting('select_search_category_color_style', array( 'default' => 'none', 'sanitize_callback' => 'blogbend_sanitize_category_color', )); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'select_search_category_color_style', array( 'label' => __('Select Category Meta', 'blogbend'), 'section' => 'blogbend_search_post_section', 'settings' => 'select_search_category_color_style', 'type' => 'select', 'choices' => array( 'none' => __( 'None', 'blogbend' ), 'has-background' => __( 'Has background', 'blogbend' ), 'has-text-color' => __( 'Has text color', 'blogbend' ), ), )));