add_section('business_roy_header_button_section', array( 'title' => esc_html__('Header CTA Button', 'business-roy'), 'panel' => 'business_roy_header_settings', 'description' => esc_html__('This CTA button will be displayed within the menu', 'business-roy') )); $wp_customize->add_setting('business_roy_header_button_enable', array( 'sanitize_callback' => 'business_roy_sanitize_text', 'default' => 'enable', 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Switch_Control($wp_customize, 'business_roy_header_button_enable', array( 'section' => 'business_roy_header_button_section', 'label' => esc_html__('Enable/Disable', 'business-roy'), 'switch_label' => array( 'enable' => esc_html__('Yes', 'business-roy'), 'disable' => esc_html__('No', 'business-roy') ), 'class' => 'switch-section' ))); $wp_customize->add_setting('business_roy_header_button_nav', array( 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses_post', 'priority' => -1, )); $wp_customize->add_control(new BusinessRoy_Custom_Control_Tab($wp_customize, 'business_roy_header_button_nav', array( 'type' => 'tab', 'section' => 'business_roy_header_button_section', 'buttons' => array( array( 'name' => esc_html__('Content', 'business-roy'), 'fields' => array( 'business_roy_hb_icon', 'business_roy_hb_title', 'business_roy_hb_text', 'business_roy_hb_link', 'business_roy_header_button_disable_mobile' ), 'active' => true, ), array( 'name' => esc_html__('Style', 'business-roy'), 'fields' => array( 'business_roy_header_button_color', 'business_roy_header_button_hover_color', 'business_roy_header_button_border_radius', 'business_roy_header_button_border_margin', 'business_roy_header_button_border_padding', 'business_roy_header_button_size', 'business_roy_header_button_width', ), ) ), ))); $wp_customize->add_setting('business_roy_hb_icon', array( 'sanitize_callback' => 'business_roy_sanitize_text', 'default' => 'fa fa-phone-volume', 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Fontawesome_Icon_Chooser($wp_customize, 'business_roy_hb_icon', array( 'section' => 'business_roy_header_button_section', 'label' => esc_html__('Icon', 'business-roy') ))); $wp_customize->add_setting('business_roy_hb_title', array( 'default' => esc_html__('Call Anytime 24/7', 'business-roy'), 'sanitize_callback' => 'business_roy_sanitize_text', 'transport' => 'postMessage' )); $wp_customize->add_control('business_roy_hb_title', array( 'section' => 'business_roy_header_button_section', 'type' => 'text', 'label' => esc_html__('Title', 'business-roy') )); $wp_customize->add_setting('business_roy_hb_text', array( 'default' => esc_html__('+01-559-236-8009', 'business-roy'), 'sanitize_callback' => 'business_roy_sanitize_text', 'transport' => 'postMessage' )); $wp_customize->add_control('business_roy_hb_text', array( 'section' => 'business_roy_header_button_section', 'type' => 'text', 'label' => esc_html__('Text', 'business-roy') )); $wp_customize->add_setting('business_roy_hb_link', array( 'default' => esc_html__('tel:5592368009', 'business-roy'), 'sanitize_callback' => 'business_roy_sanitize_text', 'transport' => 'postMessage' )); $wp_customize->add_control('business_roy_hb_link', array( 'section' => 'business_roy_header_button_section', 'type' => 'text', 'label' => esc_html__('Link', 'business-roy') )); $wp_customize->add_setting( 'business_roy_header_button_color', array( 'sanitize_callback' => 'business_roy_sanitize_field_background', 'transport' => 'postMessage', 'default' => json_encode(array( 'background' => '', 'color' => '', )), ) ); $wp_customize->add_control( new BusinessRoy_Custom_Control_Group( $wp_customize, 'business_roy_header_button_color', array( 'label' => esc_html__( 'Button', 'business-roy' ), 'section' => 'business_roy_header_button_section', 'settings' => 'business_roy_header_button_color', 'priority' => 100, ), array( 'background' => array( 'type' => 'color', 'label' => esc_html__( 'Background', 'business-roy' ), ), 'text' => array( 'type' => 'color', 'label' => esc_html__( 'Color', 'business-roy' ), ), 'margin' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Margin', 'business-roy' ), ), 'padding' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Padding', 'business-roy' ), ), 'radius' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Radius', 'business-roy' ), ), 'font-size' => array( 'type' => 'text', 'label' => esc_html__( 'Font Size', 'business-roy' ), 'description' => esc_html__( 'Enter a numeric value', 'business-roy' ) ), 'width' => array( 'type' => 'text', 'label' => esc_html__( 'Width', 'business-roy' ), 'description' => esc_html__( 'Enter a numeric value', 'business-roy' ) ), ) ) ); $wp_customize->add_setting('business_roy_header_button_hover_color', array( 'sanitize_callback' => 'business_roy_sanitize_field_background', 'transport' => 'postMessage', 'default' => json_encode(array( 'background' => '', 'color' => '', )), ) ); $wp_customize->add_control( new BusinessRoy_Custom_Control_Group( $wp_customize, 'business_roy_header_button_hover_color', array( 'label' => esc_html__( 'Button Hover', 'business-roy' ), 'section' => 'business_roy_header_button_section', 'settings' => 'business_roy_header_button_hover_color', 'priority' => 100, ), array( 'background' => array( 'type' => 'color', 'label' => esc_html__( 'Background', 'business-roy' ), ), 'text' => array( 'type' => 'color', 'label' => esc_html__( 'Color', 'business-roy' ), ) ) ) ); $wp_customize->add_setting('business_roy_header_button_disable_mobile', array( 'sanitize_callback' => 'business_roy_sanitize_text', 'default' => true, 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Checkbox_Control($wp_customize, 'business_roy_header_button_disable_mobile', array( 'section' => 'business_roy_header_button_section', 'label' => esc_html__('Disable in Mobile', 'business-roy') ))); $wp_customize->selective_refresh->add_partial( 'business_roy_header_button_refresh', array ( 'settings' => array( 'business_roy_header_button_enable', 'business_roy_hb_icon', 'business_roy_header_button_disable_mobile' ), 'selector' => '#masthead', 'container_inclusive' => true, 'render_callback' => function () { $layout = get_theme_mod('business_roy_header_layout','layout_one'); return get_template_part('header/header', str_replace("layout_","", $layout)); } ));