add_section( 'top_bar_settings', array( 'title' => __( 'Top Bar Settings', 'blossom-floral-pro' ), 'priority' => 5, 'panel' => 'general_settings', ) ); /** Enable Top Bar */ $wp_customize->add_setting( 'ed_top_bar', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_top_bar', array( 'section' => 'top_bar_settings', 'label' => __( 'Enable Top Bar', 'blossom-floral-pro' ), 'description' => __( 'Enable to show top bar on top of header.', 'blossom-floral-pro' ), ) ) ); /** Top Bar Type */ $wp_customize->add_setting( 'top_bar_type', array( 'default' => 'top_button_link', 'sanitize_callback' => 'blossom_floral_pro_sanitize_radio' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Radio_Buttonset_Control( $wp_customize, 'top_bar_type', array( 'section' => 'top_bar_settings', 'label' => __( 'Top Bar Type', 'blossom-floral-pro' ), 'description' => __( 'You can add button link or newsletter in top bar', 'blossom-floral-pro' ), 'choices' => array( 'top_button_link' => __( 'Button Link', 'blossom-floral-pro' ), 'top_newsletter' => __( 'Newsletter', 'blossom-floral-pro' ), ), 'active_callback' => 'blossom_floral_pro_topbar', ) ) ); /** Notification Text */ $wp_customize->add_setting( 'notification_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'notification_text', array( 'section' => 'top_bar_settings', 'label' => __( 'Notification Text', 'blossom-floral-pro' ), 'description' => __( 'Please add the notification text here.', 'blossom-floral-pro' ), 'type' => 'text', 'active_callback' => 'blossom_floral_pro_topbar', ) ); $wp_customize->selective_refresh->add_partial( 'notification_text', array( 'selector' => '.sticky-bar-content .container p', 'render_callback' => 'blossom_floral_pro_get_topbar_text', ) ); /** Notification Button Label */ $wp_customize->add_setting( 'notification_label', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'notification_label', array( 'type' => 'text', 'section' => 'top_bar_settings', 'label' => __( 'Notification Button Label', 'blossom-floral-pro' ), 'active_callback' => 'blossom_floral_pro_topbar', ) ); $wp_customize->selective_refresh->add_partial( 'notification_label', array( 'selector' => '.sticky-bar-content .container .btn-readmore', 'render_callback' => 'blossom_floral_pro_get_topbar_button', ) ); /** Notification Button Link */ $wp_customize->add_setting( 'notification_btn_url', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( 'notification_btn_url', array( 'type' => 'text', 'section' => 'top_bar_settings', 'label' => __( 'Notification Button Link', 'blossom-floral-pro' ), 'active_callback' => 'blossom_floral_pro_topbar', ) ); /** Enable Notification in New Tab */ $wp_customize->add_setting( 'ed_open_new_target', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_open_new_target', array( 'section' => 'top_bar_settings', 'label' => __( 'Enable to open in new window', 'blossom-floral-pro' ), 'description' => __( 'Enable/Disable to show the url to go in next window', 'blossom-floral-pro' ), 'active_callback' => 'blossom_floral_pro_topbar', ) ) ); $wp_customize->add_setting( 'topbar_color', array( 'default' => '#e5f9f9', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'topbar_color', array( 'label' => __( 'Top Bar Color', 'blossom-floral-pro' ), 'description' => __( 'Color of the topbar section.', 'blossom-floral-pro' ), 'section' => 'top_bar_settings', 'active_callback' => 'blossom_floral_pro_topbar', ) ) ); $wp_customize->add_setting( 'topbar_font_color', array( 'default' => '#001A1A', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'topbar_font_color', array( 'label' => __( 'Top Bar Font Color', 'blossom-floral-pro' ), 'description' => __( 'Font color of the top bar section.', 'blossom-floral-pro' ), 'section' => 'top_bar_settings', 'active_callback' => 'blossom_floral_pro_topbar', ) ) ); /** Top Bar Newsletter Shortcode */ if( is_btnw_activated() ){ $wp_customize->add_setting( 'top_bar_newsletter', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'top_bar_newsletter', array( 'type' => 'text', 'section' => 'top_bar_settings', 'label' => __( 'Header Newsletter Shortcode', 'blossom-floral-pro' ), 'description' => __( 'Enter the shortcode here.', 'blossom-floral-pro' ), 'active_callback' => 'blossom_floral_pro_topbar', ) ); }else{ $wp_customize->add_setting( 'header_newsletter_note', array( 'sanitize_callback' => 'wp_kses_post', ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Plugin_Recommend_Control( $wp_customize, 'header_newsletter_note', array( 'section' => 'top_bar_settings', 'label' => __('Header Newsletter Shortcode', 'blossom-floral-pro'), 'capability' => 'install_plugins', 'plugin_slug' => 'blossomthemes-email-newsletter', 'description' => sprintf(__('Please install and activate the recommended plugin %1$sBlossomThemes Email Newsletter%2$s.', 'blossom-floral-pro'), '', ''), 'active_callback' => 'blossom_floral_pro_topbar', ) ) ); } /** Top Bar Settings Ends */ } add_action( 'customize_register', 'blossom_floral_pro_customize_register_general_topbar' );