'label' => esc_html__( 'Image Size', 'tripp' ), 'description' => esc_html__( 'The header background image size.', 'tripp' ), 'type' => 'select', 'choices' => array( 'auto' => esc_html__( 'Original', 'tripp' ), 'contain' => esc_html__( 'Fit to Screen', 'tripp' ), '' => esc_html__( 'Fill Screen', 'tripp' ), ), 'active_callback' => 'tripp_customizer_is_nav_bg_image_enabled', ) ); // Navigation -> Repeated background. $wp_customize->add_setting( 'nav_bg_repeat', array( 'default' => false, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_bg_repeat', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Repeated background.', 'tripp' ), 'type' => 'checkbox', 'active_callback' => 'tripp_customizer_is_nav_bg_image_enabled', ) ); // Navigation -> Overlay Color. $wp_customize->add_setting( 'nav_bg_overlay_color', array( 'default' => '#000', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_bg_overlay_color', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Overlay Color', 'tripp' ), 'description' => esc_html__( 'The color overlay for the header background image.', 'tripp' ), 'active_callback' => 'tripp_customizer_is_nav_bg_image_enabled', ) ) ); // Navigation -> Background Overlay Opacity. $wp_customize->add_setting( 'nav_bg_overlay_opacity', array( 'default' => 75, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_number', ) ); $wp_customize->add_control( new Tripp_Customize_Range_Control( $wp_customize, 'nav_bg_overlay_opacity', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Overlay Opacity', 'tripp' ), 'description' => esc_html__( 'The header background overlay opacity.', 'tripp' ), 'input_attrs' => array( 'min' => 0, 'max' => 100, ), 'marks' => array( 0 => 0, 25 => 25, 50 => 50, 75 => 75, 100 => 100, ), 'active_callback' => 'tripp_customizer_is_nav_bg_image_enabled', ) ) ); // Navigation -> Navigation Bar Separator. $wp_customize->add_control( new Tripp_Customize_Separator_Control( $wp_customize, 'nav_bar_separator', array( 'section' => 'navigation_section', ) ) ); // Navigation -> Navigation Bar Options. $wp_customize->add_control( new Tripp_Customize_Label_Control( $wp_customize, 'nav_bar_options', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Navigation Bar Options', 'tripp' ), ) ) ); // Navigation -> Sticky Menu. $wp_customize->add_setting( 'nav_sticky_menu', array( 'default' => true, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_sticky_menu', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Sticky Menu', 'tripp' ), 'description' => esc_html__( 'Displays sticky menu when scrolling.', 'tripp' ), 'type' => 'checkbox', ) ); // Navigation -> Full Width Menu. $wp_customize->add_setting( 'nav_fullwidth_menu', array( 'default' => false, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_fullwidth_menu', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Full Width Menu', 'tripp' ), 'description' => esc_html__( 'Stretches the header menu container to full width.', 'tripp' ), 'type' => 'checkbox', ) ); // Navigation -> Extra Menu Buttons. $wp_customize->add_control( new Tripp_Customize_Label_Control( $wp_customize, 'nav_menu_buttons', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Menu Buttons', 'tripp' ), ) ) ); // Navigation -> Search Button. $wp_customize->add_setting( 'nav_search_button', array( 'default' => true, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_search_button', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Search Button', 'tripp' ), 'description' => esc_html__( 'Displays a search button.', 'tripp' ), 'type' => 'checkbox', ) ); // Navigation -> Displays a search button on mobile navigation menu by default. $wp_customize->add_setting( 'nav_search_button_mobile', array( 'default' => true, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_search_button_mobile', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Displays a search button on mobile navigation menu by default.', 'tripp' ), 'type' => 'checkbox', 'active_callback' => 'tripp_customizer_is_search_button_enabled', ) ); // Navigation -> Login Button. $wp_customize->add_setting( 'nav_login_button', array( 'default' => false, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_login_button', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Log In Button', 'tripp' ), 'description' => esc_html__( 'Displays a Log In button.', 'tripp' ), 'type' => 'checkbox', ) ); // Navigation -> Off-Canvas Sidebar Button. $wp_customize->add_setting( 'nav_sidebar_button', array( 'default' => true, 'transport' => 'postMessage', 'sanitize_callback' => 'tripp_customize_sanitize_checkbox', ) ); $wp_customize->add_control( 'nav_sidebar_button', array( 'section' => 'navigation_section', 'label' => esc_html__( 'Off-Canvas Sidebar Button', 'tripp' ), 'description' => esc_html__( 'Displays a toggle button to show or hide a slide-out sidebar.', 'tripp' ), 'type' => 'checkbox', ) ); /** * To improve user experience: * * - Move the Menus panel before the Header section. */ $wp_customize->get_panel( 'nav_menus' )->priority = 50; } add_action( 'customize_register', 'tripp_customizer_register_navigation_settings', 20 );