add_section( $section_id, array( 'title' => esc_html__( 'Jetpack Search', 'jetpack' ), 'description' => __( 'Use these settings to customize the search overlay.', 'jetpack' ), 'capability' => 'edit_theme_options', 'priority' => 200, ) ); $id = $setting_prefix . 'color_theme'; $wp_customize->add_setting( $id, array( 'default' => 'light', 'transport' => 'postMessage', 'type' => 'option', ) ); $wp_customize->add_control( $id, array( 'label' => __( 'Theme', 'jetpack' ), 'description' => __( 'A light or dark theme for your search overlay.', 'jetpack' ), 'section' => $section_id, 'type' => 'radio', 'choices' => array( 'light' => __( 'Light', 'jetpack' ), 'dark' => __( 'Dark', 'jetpack' ), ), ) ); $id = $setting_prefix . 'overlay_trigger'; $wp_customize->add_setting( $id, array( 'default' => 'immediate', 'transport' => 'postMessage', 'type' => 'option', ) ); $wp_customize->add_control( $id, array( 'label' => __( 'Overlay Trigger', 'jetpack' ), 'description' => __( 'Choose when the search overlay should appear.', 'jetpack' ), 'section' => $section_id, 'type' => 'select', 'choices' => array( 'immediate' => __( 'Open immediately', 'jetpack' ), 'results' => __( 'Open when results are available', 'jetpack' ), ), ) ); $id = $setting_prefix . 'opacity'; $wp_customize->add_setting( $id, array( 'default' => 97, 'transport' => 'postMessage', 'type' => 'option', ) ); $wp_customize->add_control( $id, array( 'type' => 'range', 'section' => $section_id, 'label' => __( 'Background Opacity', 'jetpack' ), 'description' => __( 'Select an opacity for the search overlay.', 'jetpack' ), 'input_attrs' => array( 'min' => 85, 'max' => 100, 'step' => 0.5, ), ) ); $id = $setting_prefix . 'highlight_color'; $wp_customize->add_setting( $id, array( 'default' => '#FFC', 'transport' => 'postMessage', 'type' => 'option', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $id, array( 'label' => __( 'Highlight Search Terms', 'jetpack' ), 'description' => __( 'Choose a color to highlight matching search terms.', 'jetpack' ), 'section' => $section_id, ) ) ); $id = $setting_prefix . 'inf_scroll'; $wp_customize->add_setting( $id, array( 'default' => true, 'transport' => 'postMessage', 'type' => 'option', ) ); $wp_customize->add_control( $id, array( 'type' => 'checkbox', 'section' => $section_id, 'label' => __( 'Infinite Scroll Results', 'jetpack' ), ) ); $id = $setting_prefix . 'show_powered_by'; $wp_customize->add_setting( $id, array( 'default' => true, 'transport' => 'postMessage', 'type' => 'option', ) ); $wp_customize->add_control( $id, array( 'type' => 'checkbox', 'section' => $section_id, 'label' => __( 'Display "Powered by Jetpack"', 'jetpack' ), ) ); } }