add_section( 'topbar_options' , array( 'title' => __( 'Topbar Options', 'aytias' ), 'panel' => 'aytias_option_panel', ) ); /*Enable Top Bar*/ $wp_customize->add_setting( 'aytias_options[enable_top_bar]', array( 'default' => $default_options['enable_top_bar'], 'sanitize_callback' => 'aytias_sanitize_checkbox', ) ); $wp_customize->add_control( 'aytias_options[enable_top_bar]', array( 'label' => __( 'Enable Top Bar', 'aytias' ), 'section' => 'topbar_options', 'type' => 'checkbox', ) ); /*Hide Top Bar on Mobile*/ $wp_customize->add_setting( 'aytias_options[hide_top_bar_mobile]', array( 'default' => $default_options['hide_top_bar_mobile'], 'sanitize_callback' => 'aytias_sanitize_checkbox', ) ); $wp_customize->add_control( 'aytias_options[hide_top_bar_mobile]', array( 'label' => __( 'Hide Top Bar on Mobile', 'aytias' ), 'section' => 'topbar_options', 'type' => 'checkbox', 'active_callback' => 'aytias_is_top_bar_enabled' ) ); /*Enable Today's Date*/ $wp_customize->add_setting( 'aytias_options[enable_todays_date]', array( 'default' => $default_options['enable_todays_date'], 'sanitize_callback' => 'aytias_sanitize_checkbox', ) ); $wp_customize->add_control( 'aytias_options[enable_todays_date]', array( 'label' => __( 'Enable Today\'s Date', 'aytias' ), 'section' => 'topbar_options', 'type' => 'checkbox', 'active_callback' => 'aytias_is_top_bar_enabled' ) ); /*Todays Date Format*/ $wp_customize->add_setting( 'aytias_options[todays_date_format]', array( 'default' => $default_options['todays_date_format'], 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'aytias_options[todays_date_format]', array( 'label' => __( 'Today\'s Date Format', 'aytias' ), 'description' => sprintf( wp_kses( __( 'Date and Time Formatting Documentation.', 'aytias' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://wordpress.org/support/article/formatting-date-and-time' ) ), 'section' => 'topbar_options', 'type' => 'text', 'active_callback' => function( $control ) { return ( aytias_is_top_bar_enabled( $control ) && aytias_is_todays_date_enabled( $control ) ); } ) ); /*Enable Top Social Nav*/ $wp_customize->add_setting( 'aytias_options[enable_top_bar_social_nav]', array( 'default' => $default_options['enable_top_bar_social_nav'], 'sanitize_callback' => 'aytias_sanitize_checkbox', ) ); $wp_customize->add_control( 'aytias_options[enable_top_bar_social_nav]', array( 'label' => __( 'Enable Top Bar Social Nav Menu', 'aytias' ), 'description' => sprintf( __( 'You can add/edit social nav menu from here.', 'aytias' ), "javascript:wp.customize.control( 'nav_menu_locations[social-menu]' ).focus();" ), 'section' => 'topbar_options', 'type' => 'checkbox', 'active_callback' => 'aytias_is_top_bar_enabled' ) ); /*Enable Top Nav*/ $wp_customize->add_setting( 'aytias_options[enable_top_bar_nav]', array( 'default' => $default_options['enable_top_bar_nav'], 'sanitize_callback' => 'aytias_sanitize_checkbox', ) ); $wp_customize->add_control( 'aytias_options[enable_top_bar_nav]', array( 'label' => __( 'Enable Top Bar Nav Menu', 'aytias' ), 'description' => sprintf( __( 'You can add/edit top nav menu from here.', 'aytias' ), "javascript:wp.customize.control( 'nav_menu_locations[top-menu]' ).focus();" ), 'section' => 'topbar_options', 'type' => 'checkbox', 'active_callback' => 'aytias_is_top_bar_enabled' ) ); /*Top Bar background Color*/ $wp_customize->add_setting( 'aytias_options[top_bar_bg_color]', array( 'default' => $default_options['top_bar_bg_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_bg_color]', array( 'label' => __('Top Bar Background Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) ); // Top Bar Date Color $wp_customize->add_setting( 'aytias_options[top_bar_date_color]', array( 'default' => $default_options['top_bar_date_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_date_color]', array( 'label' => __('Top Bar Date Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) ); // Top Bar Social Icons Color $wp_customize->add_setting( 'aytias_options[top_bar_social_nav_icons_color]', array( 'default' => $default_options['top_bar_social_nav_icons_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_social_nav_icons_color]', array( 'label' => __('Top Bar Social Icons Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) ); // Top Bar Social Icons Hover Color $wp_customize->add_setting( 'aytias_options[top_bar_social_nav_hover_color]', array( 'default' => $default_options['top_bar_social_nav_hover_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_social_nav_hover_color]', array( 'label' => __('Top Bar Social Icons Hover Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) ); // Top Bar Nav Menu Color $wp_customize->add_setting( 'aytias_options[top_bar_nav_menu_color]', array( 'default' => $default_options['top_bar_nav_menu_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_nav_menu_color]', array( 'label' => __('Top Bar Nav Menu Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) ); // Top Bar Nav Menu Hover Color $wp_customize->add_setting( 'aytias_options[top_bar_nav_menu_hover_color]', array( 'default' => $default_options['top_bar_nav_menu_hover_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_nav_menu_hover_color]', array( 'label' => __('Top Bar Nav Menu Hover Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) ); /*Top Bar Sub Menu Background Color*/ $wp_customize->add_setting( 'aytias_options[top_bar_sub_menu_bg_color]', array( 'default' => $default_options['top_bar_sub_menu_bg_color'], 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'aytias_options[top_bar_sub_menu_bg_color]', array( 'label' => __('Top Bar Sub Menu Background Color', 'aytias'), 'section' => 'topbar_options', 'type' => 'color', 'active_callback' => 'aytias_is_top_bar_enabled' ) ) );