add_section('bLab_scroll2top', array( 'title' => __('Scroll to Top', 'beauty-lab'), 'panel' => 'global_panel', 'priority' => 5, )); //----scroll to top style----- $wp_customize->add_setting( 'bLab_scroll2top_enable', array( 'default' => true, 'transport' => 'refresh', 'sanitize_callback' => 'themecon_sanitize_checkbox', )); $wp_customize->add_control( 'bLab_scroll2top_enable_control', array( 'label' => __( 'Enable Scroll to top', 'beauty-lab' ), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_enable', 'type' => 'checkbox', ) ); //----scroll to top postiion------ $wp_customize->add_setting( 'bLab_scroll2top_postition', array( 'default' => 'right', 'transport' => 'refresh', 'sanitize_callback' => 'themecon_sanitize_select', )); $wp_customize->add_control( 'bLab_scroll2top_postition_control', array( 'label' => __( 'Scroll to top Position', 'beauty-lab' ), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_postition', 'type' => 'radio', 'choices' => array( 'left' => __( 'Left', 'beauty-lab' ), 'right' => __( 'Right', 'beauty-lab' ), ), 'active_callback' => 'enable_scroll2top', ) ); //----scroll to top icon size------ $wp_customize->add_setting( 'bLab_scroll2top_icon_size', array( 'default' => 20, 'transport' => 'refresh', 'sanitize_callback' => 'themecon_intval', )); $wp_customize->add_control( 'bLab_scroll2top_icon_size_control', array( 'label' => __( 'Icon Size (px)', 'beauty-lab' ), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_icon_size', 'type' => 'number', 'active_callback' => 'enable_scroll2top', ) ); //----scroll to top border radius------ $wp_customize->add_setting( 'bLab_scroll2top_radius', array( 'default' => '3px', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( 'bLab_scroll2top_radius_control', array( 'label' => __( 'Border Radius', 'beauty-lab' ), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_radius', 'type' => 'text', 'input_attrs' => array( 'placeholder' => __( 'e.g. 10px or 100%', 'beauty-lab' ), ), 'active_callback' => 'enable_scroll2top', ) ); //----background color----- $wp_customize->add_setting('bLab_scroll2top_bg_color', array( 'default' => '#d5275a', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('bLab_scroll2top_bg_color_control', array( 'label' => __('Background Color', 'beauty-lab'), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_bg_color', 'type' => 'color', 'active_callback' => 'enable_scroll2top', ) ); //----Icon color----- $wp_customize->add_setting('bLab_scroll2top_icon_color', array( 'default' => '#fff', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('bLab_scroll2top_icon_color_control', array( 'label' => __('Icon Color', 'beauty-lab'), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_icon_color', 'type' => 'color', 'active_callback' => 'enable_scroll2top', ) ); // separator $wp_customize->add_setting( 'bLab_hover_separator', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => __('Hover action', 'beauty-lab'), ) ); $wp_customize->add_control( new Beauty_Lab_Separator_Control( $wp_customize, 'bLab_hover_separator_control', array( 'section' => 'bLab_scroll2top', 'settings' => 'bLab_hover_separator', 'active_callback' => 'enable_scroll2top', ) ) ); //----background color----- $wp_customize->add_setting('bLab_scroll2top_hvr_bg_color', array( 'default' => '#720f83', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('bLab_scroll2top_hvr_bg_color_control', array( 'label' => __('Background Color', 'beauty-lab'), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_hvr_bg_color', 'type' => 'color', 'active_callback' => 'enable_scroll2top', ) ); //----Icon color----- $wp_customize->add_setting('bLab_scroll2top_hvr_icon_color', array( 'default' => '#ffffff', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control('bLab_scroll2top_hvr_icon_color_control', array( 'label' => __('Icon Color', 'beauty-lab'), 'section' => 'bLab_scroll2top', 'settings' => 'bLab_scroll2top_hvr_icon_color', 'type' => 'color', 'active_callback' => 'enable_scroll2top', ) ); } add_action( 'customize_register', 'beauty_lab_customize_scroll2top' ); function enable_scroll2top(){ if( get_theme_mod( 'bLab_scroll2top_enable' ) ){ return true; }else{ return false; } } ?>