add_section( 'alley_themes_header_options_section', array( 'title' => esc_html__( 'Header Options', 'alley-themes' ), 'description' => esc_html__( 'Enable Sticky Menu', 'alley-themes' ), 'priority' => 11, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'alley_themes_header_sticky_menu_option', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false, ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'alley_themes_header_sticky_menu_option', array( 'label' => esc_html__( 'Enable Sticky Menu', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'alley_themes_header_sticky_menu_option', 'type' => 'toggle', ) ) ); $wp_customize->add_setting( 'alley_themes_header_layouts', array( 'sanitize_callback' => 'alley_themes_sanitize_choices', 'default' => 'one', ) ); $choices = array( 'one' => get_template_directory_uri() . '/images/homepage/header-layouts/header-layout-one.jpg', ); $wp_customize->add_control( new Alley_Themes_Radio_Image_Control( $wp_customize, 'alley_themes_header_layouts', array( 'label' => esc_html__( 'Header Layout', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'alley_themes_header_layouts', 'type' => 'radio-image', 'choices' => $choices, ) ) ); $wp_customize->add_setting( 'alley_themes_contact_text', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => '', ) ); $wp_customize->add_control( 'alley_themes_contact_text', array( 'label' => esc_html__( 'Contact Text', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'alley_themes_contact_text', 'type' => 'text', ) ); $wp_customize->add_setting( 'hide_show_contact_responsive', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false, ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'hide_show_contact_responsive', array( 'label' => esc_html__( 'Enable Contact In Mobile View', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'hide_show_contact_responsive', 'type' => 'toggle', ) ) ); $wp_customize->add_setting( 'alley_themes_contact_num', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '', ) ); $wp_customize->add_control( 'alley_themes_contact_num', array( 'label' => esc_html__( 'Enter Contact Number', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'alley_themes_contact_num', 'type' => 'text', ) ); $wp_customize->selective_refresh->add_partial( 'alley_themes_contact_num', array( 'selector' => '.header-wrapper .contact-number .contact-btn', ) ); $wp_customize->add_setting( 'hide_show_header_button_1', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false, ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'hide_show_header_button_1', array( 'label' => esc_html__( 'Enable Header Button 1', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'hide_show_header_button_1', 'type' => 'toggle', ) ) ); $wp_customize->add_setting( 'hide_show_header1_responsive', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false, ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'hide_show_header1_responsive', array( 'label' => esc_html__( 'Enable Header Button 1 in Mobile View', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'hide_show_header1_responsive', 'type' => 'toggle', 'active_callback' => function () { return get_theme_mod( 'hide_show_header_button_1', true ); }, ) ) ); $wp_customize->add_setting( 'header_button1_label', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '', ) ); $wp_customize->add_control( 'header_button1_label', array( 'label' => esc_html__( 'Header Button 1 Label', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'header_button1_label', 'type' => 'text', 'active_callback' => function () { return get_theme_mod( 'hide_show_header_button_1', true ); }, ) ); $wp_customize->selective_refresh->add_partial( 'header_button1_label', array( 'selector' => '.header-wrapper .contact-number .schedule-btn', ) ); $wp_customize->add_setting( 'header_button1_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'header_button1_link', array( 'label' => esc_html__( 'Header Button 1 Link', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'header_button1_link', 'type' => 'url', 'active_callback' => function () { return get_theme_mod( 'hide_show_header_button_1', true ); }, ) ); $wp_customize->add_setting( 'hide_show_header_button_2', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false, ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'hide_show_header_button_2', array( 'label' => esc_html__( 'Enable Header Button 2', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'hide_show_header_button_2', 'type' => 'toggle', ) ) ); $wp_customize->add_setting( 'hide_show_header2_responsive', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false, ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'hide_show_header2_responsive', array( 'label' => esc_html__( 'Enable Header Button 2 in Mobile View', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'hide_show_header2_responsive', 'type' => 'toggle', 'active_callback' => function () { return get_theme_mod( 'hide_show_header_button_2', true ); }, ) ) ); $wp_customize->add_setting( 'header_button2_label', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '', ) ); $wp_customize->add_control( 'header_button2_label', array( 'label' => esc_html__( 'Header Button 2 Label', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'header_button2_label', 'type' => 'text', 'active_callback' => function () { return get_theme_mod( 'hide_show_header_button_2', true ); }, ) ); $wp_customize->selective_refresh->add_partial( 'header_button2_label', array( 'selector' => '.header-wrapper .contact-number .financing-btn', ) ); $wp_customize->add_setting( 'header_button2_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'header_button2_link', array( 'label' => esc_html__( 'Header Button 2 Link', 'alley-themes' ), 'section' => 'alley_themes_header_options_section', 'settings' => 'header_button2_link', 'type' => 'url', 'active_callback' => function () { return get_theme_mod( 'hide_show_header_button_2', true ); }, ) ); }