add_section(new BusinessRoy_Toggle_Section($wp_customize, 'business_roy_service_section', array( 'title' => esc_html__('Services','business-roy'), 'panel' => 'business_roy_frontpage_settings', 'priority' => business_roy_get_section_position('business_roy_service_section'), 'hiding_control' => 'business_roy_service_service_section' ))); /** * Enable/Disable Option * * @since 1.0.0 */ $wp_customize->add_setting('business_roy_service_service_section', array( 'default' => 'disable', 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_switch', //done )); $wp_customize->add_control(new BusinessRoy_Switch_Control($wp_customize, 'business_roy_service_service_section', array( 'label' => esc_html__('Enable', 'business-roy'), 'section' => 'business_roy_service_section', 'switch_label' => array( 'enable' => esc_html__('Yes', 'business-roy'), 'disable' => esc_html__('No', 'business-roy'), ), ))); $wp_customize->add_setting('business_roy_service_nav', array( 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses_post', )); $wp_customize->add_control(new BusinessRoy_Custom_Control_Tab($wp_customize, 'business_roy_service_nav', array( 'type' => 'tab', 'section' => 'business_roy_service_section', 'priority' => 1, 'buttons' => array( array( 'name' => esc_html__('Content', 'business-roy'), 'fields' => array( 'business_roy_service_service_section', 'business_roy_service_title_heading', 'business_roy_service_super_title', 'business_roy_service_title', 'business_roy_service_text_alignment_heading', 'business_roy_service_title_align', 'business_roy_service_type_heading', 'business_roy_service_type', 'business_roy_service_setting_heading', 'business_roy_service', 'business_roy_service_advance_settings', 'business_roy_service_layout', 'business_roy_service_bg_url', 'business_roy_service_button', ), 'active' => true, ), array( 'name' => esc_html__('Style', 'business-roy'), 'fields' => array( 'business_roy_service_cs_heading', ), ), array( 'name' => esc_html__('Advanced', 'business-roy'), 'fields' => array( 'business_roy_service_bg_type', 'business_roy_service_bg_color', 'business_roy_service_bg_gradient', 'business_roy_service_padding', 'business_roy_service_margin', 'business_roy_service_cs_seperator', 'business_roy_service_section_seperator', 'business_roy_service_top_seperator', 'business_roy_service_bottom_seperator', ), ), ), ))); $wp_customize->add_setting('business_roy_service_title_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_service_title_heading', array( 'section' => 'business_roy_service_section', 'label' => esc_html__('Section Title & Sub Title', 'business-roy') ))); $wp_customize->add_setting( 'business_roy_service_super_title', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' //done ) ); $wp_customize->add_control( 'business_roy_service_super_title', array( 'label' => esc_html__( 'Super Title', 'business-roy' ), 'section' => 'business_roy_service_section', 'type' => 'text', )); // Our Service Section Title. $wp_customize->add_setting( 'business_roy_service_title', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' //done ) ); $wp_customize->add_control( 'business_roy_service_title', array( 'label' => esc_html__( 'Title', 'business-roy' ), 'section' => 'business_roy_service_section', 'type' => 'text', )); $wp_customize->add_setting('business_roy_service_text_alignment_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_service_text_alignment_heading', array( 'section' => 'business_roy_service_section', 'label' => esc_html__('Text Alignment', 'business-roy') ))); $wp_customize->add_setting('business_roy_service_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_service_title_align', array( 'choices' => array( 'text-left' => esc_html__('Left', 'business-roy'), 'text-center' => esc_html__('Center', 'business-roy'), 'text-right' => esc_html__('Right', 'business-roy'), ), 'section' => 'business_roy_service_section', 'settings' => 'business_roy_service_title_align', ) ) ); /***** * Service Type */ $wp_customize->add_setting('business_roy_service_type_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_service_type_heading', array( 'section' => 'business_roy_service_section', 'label' => esc_html__('Select Service Type', 'business-roy') ))); $wp_customize->add_setting('business_roy_service_type', array( 'default' => 'default', 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_select' )); $wp_customize->add_control('business_roy_service_type', array( 'section' => 'business_roy_service_section', 'type' => 'radio', 'choices' => array( 'default' => esc_html__('Default', 'business-roy'), 'advance' => esc_html__('Advance', 'business-roy') ) )); // Our Service Page. $wp_customize->add_setting('business_roy_service', array( 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_repeater', //done 'default' => json_encode(array( array( 'service_page' => '', 'service_icon' =>'fa fa-cogs' ) )) )); $wp_customize->add_control(new BusinessRoy_Repeater_Control( $wp_customize,'business_roy_service', array( 'label' => esc_html__('Our Services', 'business-roy'), 'section' => 'business_roy_service_section', 'settings' => 'business_roy_service', 'box_label' => esc_html__('Service', '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 ), 'icon' => array( 'type' => 'icon', 'label' => esc_html__('Icon', 'business-roy') ) ) )); /**** * Advance Service Settings */ $id = "service"; $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' => '', ) )) )); $wp_customize->add_control(new BusinessRoy_Repeater_Control( $wp_customize, "business_roy_{$id}_advance_settings", array( 'label' => esc_html__('Our Services', 'business-roy'), 'section' => "business_roy_{$id}_section", 'settings' => "business_roy_{$id}_advance_settings", 'box_label' => esc_html__('Service', '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'), ), 'button_text' => array( 'type' => 'text', 'label' => esc_html__('First Button Text', 'business-roy'), 'default' => '' ), 'button_url' => array( 'type' => 'url', 'label' => esc_html__('First Button Url', 'business-roy'), 'default' => '' ), ) )); // Our Service Section Button text. $wp_customize->add_setting( 'business_roy_service_button', array( 'default' => esc_html__( 'Read More','business-roy' ), 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' //done ) ); $wp_customize->add_control( 'business_roy_service_button', array( 'label' => esc_html__( 'Link Text', 'business-roy' ), 'section' => 'business_roy_service_section', 'type' => 'text', )); $wp_customize->add_setting('business_roy_service_setting_heading', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_service_setting_heading', array( 'section' => 'business_roy_service_section', 'label' => esc_html__('Layout Settings', 'business-roy') ))); $wp_customize->add_setting('business_roy_service_layout', array( 'sanitize_callback' => 'business_roy_sanitize_options', 'default' => 'style1', 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Selector($wp_customize, 'business_roy_service_layout', array( 'section' => 'business_roy_service_section', 'label' => esc_html__('Choose Layout', 'business-roy'), 'options' => array( 'style1' => get_template_directory_uri() . '/inc/customizer/images/service-style.png', 'style2' => get_template_directory_uri() . '/inc/customizer/images/service-style2.png', ) ))); // Service Layout One Feature Image $wp_customize->add_setting('business_roy_service_bg_url', array( 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'business_roy_service_bg_url', array( 'label' => esc_html__('Feature Image','business-roy'), 'section' => 'business_roy_service_section', ))); $wp_customize->selective_refresh->add_partial( 'business_roy_service_settings', array( 'settings' => array( 'business_roy_service_service_section', 'business_roy_service_super_title', 'business_roy_service_title', 'business_roy_service', 'business_roy_service_type', 'business_roy_service_bg_url', 'business_roy_service_advance_settings', 'business_roy_service_layout', 'business_roy_service_section_seperator', 'business_roy_service_top_seperator', 'business_roy_service_bottom_seperator' ), 'selector' => '#service-section', 'fallback_refresh' => true, 'container_inclusive' => true, 'render_callback' => function () { return get_template_part( 'section/section', 'service' ); } )); /** * Upgrade Pro Version */ $wp_customize->add_setting('business_roy_pro_service_upgrade_text', array( 'sanitize_callback' => 'business_roy_sanitize_text' )); $wp_customize->add_control(new BusinessRoy_Upgrade_Text($wp_customize, 'business_roy_pro_service_upgrade_text', array( 'section' => 'business_roy_service_section', 'label' => esc_html__('For More Settings,', 'business-roy'), 'choices' => array( esc_html__('5+ Different Layouts ( Also available List & Slide)', 'business-roy'), esc_html__('Change Options for Timeline Style', 'business-roy'), esc_html__('Change Title & Sub Title Colors', 'business-roy'), esc_html__('4+ Different Background Type 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 )));