add_section(new BusinessRoy_Toggle_Section($wp_customize, 'business_roy_promoservice_section', array( 'title' => esc_html__('Feature Services', 'business-roy'), 'panel' => 'business_roy_frontpage_settings', 'priority' => business_roy_get_section_position('business_roy_promoservice_section'), 'hiding_control' => 'business_roy_promoservice_section' ))); /** * Enable/Disable Option * * @since 1.0.0 */ $wp_customize->add_setting('business_roy_promoservice_section', array( 'default' => 'enable', 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_switch', //done )); $wp_customize->add_control(new BusinessRoy_Switch_Control($wp_customize, 'business_roy_promoservice_section', array( 'label' => esc_html__('Enable/Disable', 'business-roy'), 'section' => 'business_roy_promoservice_section', 'switch_label' => array( 'enable' => esc_html__('Yes', 'business-roy'), 'disable' => esc_html__('No', 'business-roy'), ), 'class' => 'switch-section', 'priority' => 2 ))); $wp_customize->add_setting('business_roy_promoservice_nav', array( 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses_post', )); $wp_customize->add_control(new BusinessRoy_Custom_Control_Tab($wp_customize, 'business_roy_promoservice_nav', array( 'type' => 'tab', 'section' => 'business_roy_promoservice_section', 'priority' => 1, 'buttons' => array( array( 'name' => esc_html__('Content', 'business-roy'), 'fields' => array( 'business_roy_promoservice_section', 'business_roy_promoservice_title_heading', 'business_roy_promoservice_super_title', 'business_roy_promoservice_title', 'business_roy_promoservice_alignment_heading', 'business_roy_promoservice_title_align', 'business_roy_promoservice_type_heading', 'business_roy_promoservice_type', 'business_roy_promoservice', 'business_roy_promoservice_advance_settings', 'business_roy_promoservice_show_image', 'business_roy_promoservice_style', ), 'active' => true, ), array( 'name' => esc_html__('Style', 'business-roy'), 'fields' => array( 'promoservice_grid', 'business_roy_promoservice_icon_style', ), ), array( 'name' => esc_html__('Advanced', 'business-roy'), 'fields' => array( 'business_roy_promoservice_bg_type', 'business_roy_promoservice_bg_color', 'business_roy_promoservice_bg_gradient', 'business_roy_promoservice_padding', 'business_roy_promoservice_margin', 'business_roy_promoservice_cs_seperator', 'business_roy_promoservice_section_seperator', 'business_roy_promoservice_top_seperator', 'business_roy_promoservice_bottom_seperator', ), ), ), ))); $wp_customize->add_setting('business_roy_promoservice_title_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_promoservice_title_heading', array( 'section' => 'business_roy_promoservice_section', 'label' => esc_html__('Section Title & Sub Title', 'business-roy') ))); $wp_customize->add_setting('business_roy_promoservice_super_title', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', 'default' => get_theme_mod('business_roy_service_title', '') )); $wp_customize->add_control('business_roy_promoservice_super_title', array( 'section' => 'business_roy_promoservice_section', 'type' => 'text', 'label' => esc_html__('Super Title', 'business-roy') )); $wp_customize->add_setting('business_roy_promoservice_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => get_theme_mod('business_roy_service_subtitle', ''), 'transport' => 'postMessage' )); $wp_customize->add_control('business_roy_promoservice_title', array( 'section' => 'business_roy_promoservice_section', 'type' => 'text', 'label' => esc_html__('Title', 'business-roy') )); $wp_customize->add_setting('business_roy_promoservice_alignment_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_promoservice_alignment_heading', array( 'section' => 'business_roy_promoservice_section', 'label' => esc_html__('Alignment', 'business-roy') ))); $wp_customize->add_setting('business_roy_promoservice_title_align', array( 'default' => 'text-center', 'sanitize_callback' => 'business_roy_sanitize_select', 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Custom_Control_Buttonset($wp_customize,'business_roy_promoservice_title_align', array( 'choices' => array( 'text-left' => esc_html__('Left', 'business-roy'), 'text-right' => esc_html__('Right', 'business-roy'), 'text-center' => esc_html__('Center', 'business-roy'), ), 'section' => 'business_roy_promoservice_section', 'settings' => 'business_roy_promoservice_title_align', )) ); $wp_customize->add_setting('business_roy_promoservice_type_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_promoservice_type_heading', array( 'section' => 'business_roy_promoservice_section', 'label' => esc_html__('Select Feature Service Type', 'business-roy') ))); $wp_customize->add_setting('business_roy_promoservice_type', array( 'default' => 'default', 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_select' )); $wp_customize->add_control('business_roy_promoservice_type', array( 'section' => 'business_roy_promoservice_section', 'type' => 'radio', 'choices' => array( 'default' => esc_html__('Default', 'business-roy'), 'advance' => esc_html__('Advance', 'business-roy') ) )); $wp_customize->add_setting('business_roy_promoservice', array( 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_repeater', //done 'default' => json_encode(array( array( 'service_page' => '', 'service_icon' =>'fas fa-address-card', 'bg_color' => '', 'color' => '', 'alignment' => '', ) )) )); $wp_customize->add_control(new BusinessRoy_Repeater_Control( $wp_customize, 'business_roy_promoservice', array( 'label' => esc_html__('Services Items', 'business-roy'), 'section' => 'business_roy_promoservice_section', 'settings' => 'business_roy_promoservice', 'box_label' => esc_html__('Service Item', 'business-roy'), 'add_label' => esc_html__('Add New', 'business-roy'), ), array( 'service_page' => array( 'type' => 'select', 'label' => esc_html__('Select Page', 'business-roy'), 'options' => $pages ), 'service_icon' => array( 'type' => 'icon', 'label' => esc_html__('Choose Icon', 'business-roy'), 'default' => 'fas fa-address-card' ), 'bg_color' => array( 'type' => 'colorpicker', 'label' => esc_html__( 'Background', 'business-roy' ), ), 'alignment' => array( 'type' => 'select', 'label' => esc_html__("Alignment", 'business-roy'), 'default' => 'text-center', 'options' => array( 'text-left' => esc_html__('Left', 'business-roy'), 'text-center' => esc_html__('Center', 'business-roy'), 'text-right' => esc_html__('Right', 'business-roy') ) ) ) )); /**** * Advance Promo Feature Services */ $id = "promoservice"; $wp_customize->add_setting("business_roy_{$id}_advance_settings", array( 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_repeater', //done 'default' => json_encode(array( array( 'block_image' => '', 'block_icon' => 'fas fa-address-card', 'block_title' => '', 'block_desc' => '', 'button_text' => '', 'button_url' => '', 'block_bg_color' => '', 'block_color' => '', 'block_alignment' => '', ) )) )); $wp_customize->add_control(new BusinessRoy_Repeater_Control( $wp_customize, "business_roy_{$id}_advance_settings", array( 'label' => esc_html__('Services Items', 'business-roy'), 'section' => "business_roy_{$id}_section", 'settings' => "business_roy_{$id}_advance_settings", 'box_label' => esc_html__('Service Item', 'business-roy'), 'add_label' => esc_html__('Add New', 'business-roy'), ), array( 'block_image' => array( 'type' => 'upload', 'label' => __("Upload Image", 'business-roy'), ), 'block_icon' => array( 'type' => 'icon', 'label' => esc_html__('Choose Icon', 'business-roy'), 'default' => 'fas fa-address-card' ), 'block_title' => array( 'type' => 'text', 'label' => __("Title", 'business-roy'), ), 'block_desc' => array( 'type' => 'textarea', 'label' => __("Short Description", 'business-roy'), ), 'block_bg_color' => array( 'type' => 'colorpicker', 'label' => esc_html__( 'Background', 'business-roy' ), ), 'block_alignment' => array( 'type' => 'select', 'label' => esc_html__("Alignment", 'business-roy'), 'default' => 'text-center', 'options' => array( 'text-left' => esc_html__('Left', 'business-roy'), 'text-center' => esc_html__('Center', 'business-roy'), 'text-right' => esc_html__('Right', 'business-roy') ) ), 'button_text' => array( 'type' => 'text', 'label' => esc_html__('Enter First Button Text', 'business-roy'), 'default' => '' ), 'button_url' => array( 'type' => 'url', 'label' => esc_html__('Enter First Button Url', 'business-roy'), 'default' => '' ), ) )); $wp_customize->add_setting('business_roy_promoservice_show_image', array( 'default' => 'enable', 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_switch', //done )); $wp_customize->add_control(new BusinessRoy_Switch_Control($wp_customize, 'business_roy_promoservice_show_image', array( 'label' => esc_html__('Display Image', 'business-roy'), 'section' => 'business_roy_promoservice_section', 'switch_label' => array( 'enable' => esc_html__('Yes', 'business-roy'), 'disable' => esc_html__('No', 'business-roy'), ) ))); $wp_customize->add_setting('business_roy_promoservice_style', array( 'sanitize_callback' => 'business_roy_sanitize_options', 'default' => 'style1', 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Selector($wp_customize, 'business_roy_promoservice_style', array( 'section' => 'business_roy_promoservice_section', 'label' => esc_html__('Choose Layout', 'business-roy'), 'options' => array( 'style1' => get_template_directory_uri() . '/inc/customizer/images/f-service-style1.png', 'style2' => get_template_directory_uri() . '/inc/customizer/images/f-service-style2.png' ) ))); /** Service Section Grid */ $wp_customize->add_setting( 'promoservice_grid', array( 'sanitize_callback' => 'business_roy_sanitize_field_background', 'transport' => 'postMessage', 'default' => json_encode(array( 'margin' => '', 'padding' => '', 'radius' => '', )), ) ); $wp_customize->add_control(new BusinessRoy_Custom_Control_Group( $wp_customize, 'promoservice_grid', array( 'label' => esc_html__( 'Grid Settings', 'business-roy' ), 'section' => 'business_roy_promoservice_section', 'settings' => 'promoservice_grid', 'priority' => 100, ), array( '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' ), ) ) ) ); $wp_customize->add_setting('business_roy_promoservice_icon_style', array( 'sanitize_callback' => 'business_roy_sanitize_field_background', 'transport' => 'postMessage', 'default' => json_encode(array( 'padding' => '', 'color' => '', 'bordercolor' => '', 'borderwidth' => '', )), ) ); $wp_customize->add_control( new BusinessRoy_Custom_Control_Group( $wp_customize, 'business_roy_promoservice_icon_style', array( 'label' => esc_html__( 'Icon Settings', 'business-roy' ), 'section' => 'business_roy_promoservice_section', 'settings' => 'business_roy_promoservice_icon_style', 'priority' => 100, ), array( 'padding' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Padding', 'business-roy' ), ), 'color' => array( 'type' => 'color', 'label' => esc_html__( 'Color', 'business-roy' ), ), 'borderwidth' => array( 'type' => 'text', 'label' => esc_html__( 'Border Width', 'business-roy' ), ), 'bordercolor' => array( 'type' => 'color', 'label' => esc_html__( 'Border Color', 'business-roy' ), ) ) ) ); $wp_customize->selective_refresh->add_partial( 'business_roy_promoservice_refresh', array ( 'settings' => array( 'business_roy_promoservice_section', 'business_roy_promoservice', 'business_roy_promoservice_type', 'business_roy_promoservice_advance_settings', 'business_roy_promoservice_section_seperator', 'business_roy_promoservice_top_seperator', 'business_roy_promoservice_bottom_seperator' ), 'selector' => '#promoservice-section', 'fallback_refresh' => true, 'container_inclusive' => true, 'render_callback' => function () { return get_template_part( 'section/section', 'promoservice' ); } )); /** * Upgrade Pro Version */ $wp_customize->add_setting('business_roy_pro_promoservice_upgrade_text', array( 'sanitize_callback' => 'business_roy_sanitize_text' )); $wp_customize->add_control(new BusinessRoy_Upgrade_Text($wp_customize, 'business_roy_pro_promoservice_upgrade_text', array( 'section' => 'business_roy_promoservice_section', 'label' => esc_html__('For More Settings,', 'business-roy'), 'choices' => array( esc_html__('6+ Different Layouts', 'business-roy'), esc_html__('Toggle On/Off Box Shadow, Icon & Read More', 'business-roy'), esc_html__('Advanced Services Items Settings', 'business-roy'), esc_html__('Change Title & Sub Title Colors with 5 different layout', 'business-roy'), esc_html__('Advanced Icon Settings ( Background Color/Color/Border Color/Border Width & Padding )', 'business-roy'), esc_html__('4+ Different Background Options( Color/Video/Gradient/Image ) ', 'business-roy'), esc_html__('More Than 30+ Top & Bottom Separator Shape Illustrator with Color & Height Options', 'business-roy'), ), 'priority' => 250 )));