add_panel( 'navigation', array( 'priority' => 3, 'title' => esc_html( __( 'Navigation', 'smerk' ) ), 'description' => esc_html( __( 'Navigation Menu Panel', 'smerk' ) ), 'icon' => 'dashicons-admin-site', ) ); // Navigation Section $wp_customize->add_section( 'navigation_general', array( 'title' => esc_html( __( 'General', 'smerk' ) ), 'panel' => 'navigation', 'priority' => 221, 'icon' => 'dashicons-admin-tools', ) ); $wp_customize->add_section( 'navigation_desktop_menu', array( 'title' => esc_html( __( 'Desktop menu', 'smerk' ) ), 'panel' => 'navigation', 'priority' => 223, 'icon' => 'dashicons-desktop', ) ); $wp_customize->add_section( 'navigation_typography', array( 'title' => esc_html( __( 'Typography', 'smerk' ) ), 'panel' => 'navigation', 'priority' => 222, 'icon' => 'dashicons-desktop', ) ); // Navigation Settings $wp_customize->add_setting( 'nav_mar' , array( 'default' => '13px 0px 0px 0px', 'transport' => 'postMessage', 'sanitize_callback' => 'bookish_sanitize_text' ) ); $wp_customize->add_setting( 'nav_pad' , array( 'default' => '10px 15px', 'transport' => 'postMessage', 'sanitize_callback' => 'bookish_sanitize_text' ) ); $wp_customize->add_setting( 'nav_link_color' , array( 'default' => '#FFFFFF', 'transport' => 'refresh', 'sanitize_callback' => 'smerk_sanitize_hexcolor', ) ); $wp_customize->add_setting('content_nav', array( 'default' => 'Roboto', 'transport' => 'refresh', 'sanitize_callback' => 'font_family_sanitize' )); $wp_customize->add_setting('content_nav_font', array( 'default' => '16px', 'transport' => 'refresh', 'sanitize_callback' => 'bookish_sanitize_text' )); $wp_customize->add_setting( 'active_link_text_color' , array( 'default' => '#FFFFFF', 'transport' => 'refresh', 'sanitize_callback' => 'smerk_sanitize_hexcolor', ) ); //Navigation Control $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'nav_mar', array( 'label' => __( 'Navigation Menu Margin', 'smerk' ), 'help' => esc_html( __( 'Set up margin for main menu', 'smerk' ) ), 'section' => 'navigation_general', 'settings' => 'nav_mar', ) ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'nav_pad', array( 'label' => __( 'Navigation Menu Padding', 'smerk' ), 'help' => esc_html( __( 'Set up padding for main menu', 'smerk' ) ), 'section' => 'navigation_general', 'settings' => 'nav_pad', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_link', array( 'label' => __( 'Navigation Link Color', 'smerk' ), 'help' => esc_html( __( 'Set up Color for Navigation main menu', 'smerk' ) ), 'section' => 'navigation_desktop_menu', 'settings' => 'nav_link_color', ) ) ); // $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_active_link', array( // 'label' => __( 'Active Link color', 'smerk' ), // 'help' => esc_html( __( 'Choose color for active text link', 'smerk' ) ), // 'section' => 'navigation_desktop_menu', // 'settings' => 'active_link_color', // ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_active_link_text', array( 'label' => __( 'Active Link color', 'smerk' ), 'help' => esc_html( __( 'Choose color for active text link', 'smerk' ) ), 'section' => 'navigation_desktop_menu', 'settings' => 'active_link_text_color', ) ) ); $wp_customize->add_control(new WP_Customize_Control( $wp_customize,'content_nav', array( 'section' => 'navigation_typography', 'settings' => 'content_nav', 'label' => 'Font Family', 'type' => 'select', 'choices' => array( 'Source Sans Pro' => 'Source Sans Pro', 'Roboto' => 'Roboto', ), ) )); $wp_customize->add_control(new WP_Customize_Control( $wp_customize,'content_nav_font', array( 'section' => 'navigation_typography', 'settings' => 'content_nav_font', 'label' => 'Font Size', 'type' => 'text', ))); /** * Adds sanitization callback function: colors * @package Sparkling */ function smerk_sanitize_hexcolor($color) { if ($unhashed = sanitize_hex_color_no_hash($color)) return '#' . $unhashed; return $color; } ?>