add_section(new BusinessRoy_Toggle_Section($wp_customize, 'business_roy_counter_section', array( 'title' => esc_html__('Counter','business-roy'), 'panel' => 'business_roy_frontpage_settings', 'priority' => business_roy_get_section_position('business_roy_counter_section'), 'hiding_control' => 'business_roy_counter_section' ))); $wp_customize->add_setting('business_roy_counter_section_nav', array( 'transport' => 'postMessage', 'sanitize_callback' => 'wp_kses_post', )); $wp_customize->add_control(new BusinessRoy_Custom_Control_Tab($wp_customize, 'business_roy_counter_section_nav', array( 'type' => 'tab', 'section' => 'business_roy_counter_section', 'priority' => 1, 'buttons' => array( array( 'name' => esc_html__('Content', 'business-roy'), 'fields' => array( 'business_roy_counter_section', 'business_roy_counter_title_heading', 'business_roy_counter_super_title', 'business_roy_counter_title', 'business_roy_counter_title_align', 'business_roy_counter', 'business_roy_counter_box_shadow_section', 'business_roy_counter_layout' ), 'active' => true, ), array( 'name' => esc_html__('Style', 'business-roy'), 'fields' => array( 'business_roy_counter_cs_heading', 'business_roy_counter_icon_style', 'business_roy_counter_group_style' ), ), array( 'name' => esc_html__('Advanced', 'business-roy'), 'fields' => array( 'business_roy_counter_bg_type', 'business_roy_counter_bg_color', 'business_roy_counter_bg_gradient', 'business_roy_counter_padding', 'business_roy_counter_margin', 'business_roy_counter_section_seperator', 'business_roy_counter_top_seperator', 'business_roy_counter_bottom_seperator', ), ), ), ))); /** * Enable/Disable Option * * @since 1.0.0 */ $wp_customize->add_setting('business_roy_counter_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_counter_section', array( 'label' => esc_html__('Enable', 'business-roy'), 'section' => 'business_roy_counter_section', 'switch_label' => array( 'enable' => esc_html__('Yes', 'business-roy'), 'disable' => esc_html__('No', 'business-roy'), ), ))); $wp_customize->add_setting('business_roy_counter_title_heading', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', )); $wp_customize->add_control(new BusinessRoy_Customize_Heading($wp_customize, 'business_roy_counter_title_heading', array( 'section' => 'business_roy_counter_section', 'label' => esc_html__('Section Title & Sub Title', 'business-roy') ))); // Counter Section Title. $wp_customize->add_setting('business_roy_counter_super_title', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' //done )); $wp_customize->add_control('business_roy_counter_super_title', array( 'label' => esc_html__('Super Title','business-roy'), 'section' => 'business_roy_counter_section', 'type' => 'text', )); // Counter Section Title. $wp_customize->add_setting('business_roy_counter_title', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field' //done )); $wp_customize->add_control('business_roy_counter_title', array( 'label' => esc_html__('Title','business-roy'), 'section' => 'business_roy_counter_section', 'type' => 'text', )); $wp_customize->add_setting('business_roy_counter_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_counter_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'), ), 'label' => esc_html__( 'Alignment', 'business-roy' ), 'section' => 'business_roy_counter_section', 'settings' => 'business_roy_counter_title_align', ) ) ); // Counter Section. $wp_customize->add_setting('business_roy_counter', array( 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_repeater', //done 'default' => json_encode(array( array( 'counter_icon' =>'', 'counter_title' =>'', 'counter_number' =>'', 'counter_suffix' => '', 'counter_alignment' => '', ) )) )); $wp_customize->add_control(new BusinessRoy_Repeater_Control( $wp_customize, 'business_roy_counter', array( 'label' => esc_html__('Counter Items', 'business-roy'), 'section' => 'business_roy_counter_section', 'settings' => 'business_roy_counter', 'box_label' => esc_html__('Counter Item', 'business-roy'), 'add_label' => esc_html__('Add New', 'business-roy'), ), array( 'counter_icon' => array( 'type' => 'icon', 'label' => esc_html__('Choose Icon', 'business-roy'), 'default' => 'fa fa-cogs' ), 'counter_title' => array( 'type' => 'text', 'label' => esc_html__('Title', 'business-roy'), 'default' => '' ), 'counter_number' => array( 'type' => 'text', 'label' => esc_html__('Number', 'business-roy'), 'default' => '' ), 'counter_suffix' => array( 'type' => 'text', 'label' => esc_html__('Suffix', 'business-roy'), 'default' => '' ), 'counter_alignment' => array( 'type' => 'select', 'label' => esc_html__("Alignment", 'business-roy'), 'default' => 'text-left', 'options' => array( 'text-left' => esc_html__('Left', 'business-roy'), 'text-center' => esc_html__('Center', 'business-roy'), 'text-right' => esc_html__('Right', 'business-roy') ) ) ) )); $wp_customize->add_setting('business_roy_counter_box_shadow_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_counter_box_shadow_section', array( 'label' => esc_html__('Box Shadow', 'business-roy'), 'section' => 'business_roy_counter_section', 'switch_label' => array( 'enable' => esc_html__('Yes', 'business-roy'), 'disable' => esc_html__('No', 'business-roy'), ), 'class' => 'switch-section', ))); $wp_customize->add_setting( 'business_roy_counter_group_style', array( 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_field_background', 'default' => json_encode(array( 'padding', 'radius', 'bg_color', 'color', 'bordercolor', 'borderwidth', )), ) ); $wp_customize->add_control( new BusinessRoy_Custom_Control_Group( $wp_customize, 'business_roy_counter_group_style', array( 'label' => esc_html__( 'Item Settings', 'business-roy' ), 'section' => 'business_roy_counter_section', 'settings' => 'business_roy_counter_group_style', 'priority' => 56, ), array( 'padding' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Padding', 'business-roy' ), ), 'radius' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Radius', 'business-roy' ), ), 'bg_color' => array( 'type' => 'color', 'label' => esc_html__( 'Background', '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->add_setting( 'business_roy_counter_icon_style', array( 'transport' => 'postMessage', 'sanitize_callback' => 'business_roy_sanitize_field_background', 'default' => json_encode(array( 'padding', 'radius', 'bg_color', 'color', 'bordercolor', 'borderwidth', )), ) ); $wp_customize->add_control( new BusinessRoy_Custom_Control_Group( $wp_customize, 'business_roy_counter_icon_style', array( 'label' => esc_html__( 'Item Icon Settings', 'business-roy' ), 'section' => 'business_roy_counter_section', 'settings' => 'business_roy_counter_icon_style', 'priority' => 56, ), array( 'padding' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Padding', 'business-roy' ), ), 'radius' => array( 'type' => 'cssbox', 'label' => esc_html__( 'Radius', 'business-roy' ), ), 'bg_color' => array( 'type' => 'color', 'label' => esc_html__( 'Background', '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_counter_section_refresh", array ( 'settings' => array( 'business_roy_counter_section', 'business_roy_counter_box_shadow_section', 'business_roy_counter', 'business_roy_counter_section_seperator', 'business_roy_counter_top_seperator', 'business_roy_counter_bottom_seperator', ), 'selector' => "#counter-section", 'fallback_refresh' => true, 'container_inclusive' => true, 'render_callback' => function () { return get_template_part( 'section/section-counter' ); } )); $wp_customize->add_setting('business_roy_counter_layout', array( 'sanitize_callback' => 'business_roy_sanitize_options', 'default' => 'layoutone', 'transport' => 'postMessage' )); $wp_customize->add_control(new BusinessRoy_Selector($wp_customize, 'business_roy_counter_layout', array( 'section' => 'business_roy_counter_section', 'label' => esc_html__('Layout', 'business-roy'), 'options' => array( 'layoutone' => get_template_directory_uri() . '/inc/customizer/images/counter.png' ) ))); /** * Upgrade Pro Version */ $wp_customize->add_setting('business_roy_pro_counter_upgrade_text', array( 'sanitize_callback' => 'business_roy_sanitize_text' )); $wp_customize->add_control(new BusinessRoy_Upgrade_Text($wp_customize, 'business_roy_pro_counter_upgrade_text', array( 'section' => 'business_roy_counter_section', 'label' => esc_html__('For More Settings,', 'business-roy'), 'choices' => array( esc_html__('Choice of Several Advanced Layouts', 'business-roy'), esc_html__('Specify Number of Columns to Display', 'business-roy'), esc_html__('Availability of Various Counter Styles', '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, 'active_callback' => 'business_roy_upgrade_notice', )));