<commit_before><?php

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return;
}

require_once locate_template( '/lib/customizer/custom-controls/checkbox.php' );
require_once locate_template( '/lib/customizer/custom-controls/color.php' );
require_once locate_template( '/lib/customizer/custom-controls/image.php' );
require_once locate_template( '/lib/customizer/custom-controls/radio.php' );
require_once locate_template( '/lib/customizer/custom-controls/select.php' );
require_once locate_template( '/lib/customizer/custom-controls/sliderui.php' );
require_once locate_template( '/lib/customizer/custom-controls/text.php' );
require_once locate_template( '/lib/customizer/custom-controls/textarea.php' );
require_once locate_template( '/lib/customizer/custom-controls/upload.php' );
require_once locate_template( '/lib/customizer/custom-controls/sortable.php' );
require_once locate_template( '/lib/customizer/custom-controls/number.php' );
require_once locate_template( '/lib/customizer/custom-controls/multicheck.php' );

function shoestrap_customizer_controls( $wp_customize ) {

	$controls = apply_filters( 'shoestrap/customizer/controls', array() );

	if ( isset( $controls ) ) {
		foreach ( $controls as $control ) {

			// Add settings
			$wp_customize->add_setting( $control['setting'], array(
				'default'    => $control['default'],
				'type'       => 'theme_mod',
				'capability' => 'edit_theme_options'
			) );

			// Checkbox controls
			if ( 'checkbox' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Checkbox_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Color Controls
			} elseif ( 'color' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Color_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => isset( $control['priority'] ) ? $control['priority'] : '',
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Image Controls
			} elseif ( 'image' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Image_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Radio Controls
			} elseif ( 'radio' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Radio_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'mode'        => isset( $control['mode'] ) ? $control['mode'] : 'radio', // Can be 'radio', 'image' or 'buttonset'.
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Select Controls
			} elseif ( 'select' == $control['type'] ) {

				$wp_customize->add_control( new SS_Select_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Slider Controls
			} elseif ( 'slider' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Sliderui_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Text Controls
			} elseif ( 'text' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Text_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Text Controls
			} elseif ( 'textarea' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Textarea_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Upload Controls
			} elseif ( 'upload' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Upload_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Sortable Controls
			} elseif ( 'sortable' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Sortable_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Number Controls
			} elseif ( 'sortable' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Number_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
					) )
				);

			// Multicheck Controls
			} elseif ( 'multicheck' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Multicheck_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);
			}
		}
	}
}
add_action( 'customize_register', 'shoestrap_customizer_controls' );

function shoestrap_enqueue_customizer_controls_styles() {

	wp_register_style( 'ss-customizer-css', get_template_directory_uri() . '/lib/customizer/assets/customizer.css', NULL, NULL, 'all' );
	wp_register_style( 'ss-customizer-ui',  get_template_directory_uri() . '/lib/customizer/assets/jquery-ui-1.10.0.custom.css', NULL, NULL, 'all' );
	wp_enqueue_style( 'ss-customizer-css' );
	wp_enqueue_style( 'ss-customizer-ui' );

	wp_enqueue_script( 'ss_customizer_js', get_template_directory_uri() . '/lib/customizer/assets/js/customizer.js');
	wp_enqueue_script( 'tipsy', get_template_directory_uri() . '/lib/customizer/assets/js/tooltipsy.min.js', array( 'jquery' ) );

}
add_action( 'customize_controls_print_styles', 'shoestrap_enqueue_customizer_controls_styles' );

function shoestrap_googlefonts_styling() { ?>
	<link href='http://fonts.googleapis.com/css?family=Roboto:100,400|Roboto+Slab:700,400&subset=latin,cyrillic-ext,greek,vietnamese,latin-ext,cyrillic' rel='stylesheet' type='text/css'>
	<?php
}
add_action( 'customize_controls_print_styles', 'shoestrap_googlefonts_styling' );
<commit_msg>bugfix for number controls<commit_after><?php

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return;
}

require_once locate_template( '/lib/customizer/custom-controls/checkbox.php' );
require_once locate_template( '/lib/customizer/custom-controls/color.php' );
require_once locate_template( '/lib/customizer/custom-controls/image.php' );
require_once locate_template( '/lib/customizer/custom-controls/radio.php' );
require_once locate_template( '/lib/customizer/custom-controls/select.php' );
require_once locate_template( '/lib/customizer/custom-controls/sliderui.php' );
require_once locate_template( '/lib/customizer/custom-controls/text.php' );
require_once locate_template( '/lib/customizer/custom-controls/textarea.php' );
require_once locate_template( '/lib/customizer/custom-controls/upload.php' );
require_once locate_template( '/lib/customizer/custom-controls/sortable.php' );
require_once locate_template( '/lib/customizer/custom-controls/number.php' );
require_once locate_template( '/lib/customizer/custom-controls/multicheck.php' );

function shoestrap_customizer_controls( $wp_customize ) {

	$controls = apply_filters( 'shoestrap/customizer/controls', array() );

	if ( isset( $controls ) ) {
		foreach ( $controls as $control ) {

			// Add settings
			$wp_customize->add_setting( $control['setting'], array(
				'default'    => $control['default'],
				'type'       => 'theme_mod',
				'capability' => 'edit_theme_options'
			) );

			// Checkbox controls
			if ( 'checkbox' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Checkbox_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Color Controls
			} elseif ( 'color' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Color_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => isset( $control['priority'] ) ? $control['priority'] : '',
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Image Controls
			} elseif ( 'image' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Image_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Radio Controls
			} elseif ( 'radio' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Radio_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'mode'        => isset( $control['mode'] ) ? $control['mode'] : 'radio', // Can be 'radio', 'image' or 'buttonset'.
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Select Controls
			} elseif ( 'select' == $control['type'] ) {

				$wp_customize->add_control( new SS_Select_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Slider Controls
			} elseif ( 'slider' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Sliderui_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Text Controls
			} elseif ( 'text' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Text_Control( $wp_customize, $control['setting'], array(
						'label'       => isset( $control['label'] ) ? $control['label'] : '',
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Text Controls
			} elseif ( 'textarea' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Textarea_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Upload Controls
			} elseif ( 'upload' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Upload_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Sortable Controls
			} elseif ( 'sortable' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Sortable_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);

			// Number Controls
			} elseif ( 'number' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Number_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
					) )
				);

			// Multicheck Controls
			} elseif ( 'multicheck' == $control['type'] ) {

				$wp_customize->add_control( new SS_Customize_Multicheck_Control( $wp_customize, $control['setting'], array(
						'label'       => $control['label'],
						'section'     => $control['section'],
						'settings'    => $control['setting'],
						'priority'    => $control['priority'],
						'choices'     => $control['choices'],
						'description' => isset( $control['description'] ) ? $control['description'] : null,
						'subtitle'    => isset( $control['subtitle'] ) ? $control['subtitle'] : '',
						'separator'   => isset( $control['separator'] ) ? $control['separator'] : false,
						'required'    => isset( $control['required'] ) ? $control['required'] : array(),
					) )
				);
			}
		}
	}
}
add_action( 'customize_register', 'shoestrap_customizer_controls' );

function shoestrap_enqueue_customizer_controls_styles() {

	wp_register_style( 'ss-customizer-css', get_template_directory_uri() . '/lib/customizer/assets/customizer.css', NULL, NULL, 'all' );
	wp_register_style( 'ss-customizer-ui',  get_template_directory_uri() . '/lib/customizer/assets/jquery-ui-1.10.0.custom.css', NULL, NULL, 'all' );
	wp_enqueue_style( 'ss-customizer-css' );
	wp_enqueue_style( 'ss-customizer-ui' );

	wp_enqueue_script( 'ss_customizer_js', get_template_directory_uri() . '/lib/customizer/assets/js/customizer.js');
	wp_enqueue_script( 'tipsy', get_template_directory_uri() . '/lib/customizer/assets/js/tooltipsy.min.js', array( 'jquery' ) );

}
add_action( 'customize_controls_print_styles', 'shoestrap_enqueue_customizer_controls_styles' );

function shoestrap_googlefonts_styling() { ?>
	<link href='http://fonts.googleapis.com/css?family=Roboto:100,400|Roboto+Slab:700,400&subset=latin,cyrillic-ext,greek,vietnamese,latin-ext,cyrillic' rel='stylesheet' type='text/css'>
	<?php
}
add_action( 'customize_controls_print_styles', 'shoestrap_googlefonts_styling' );

{'fraction_non_alphanumeric': 0.20257873599661805, 'fraction_numerical': 0.0013527795392094695, 'mean_word_length': 3.7751312071053693, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 245, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1757028', 'n_tokens_mistral': 8786, 'n_tokens_neox': 7401, 'n_words': 1211}