<commit_before><?php

/**
 * Add the required script.
 */
function kirki_required_script() {

	$controls = apply_filters( 'kirki/controls', array() );

	if ( isset( $controls ) ) {

		foreach ( $controls as $control ) {

			if ( isset( $control['required'] ) && ! is_null( $control['required'] && is_array( $control['required'] ) ) ) {

				foreach ( $control['required'] as $id => $value ) : ?>

					<script>
						jQuery(document).ready(function($) {
							<?php if ( isset( $id ) && isset( $value ) ) : ?>
							 	<?php if ( $value == get_theme_mod( $id ) ) : ?>
									$( '[id="customize-control-<?php echo $control['setting']; ?>"]' ).fadeIn(300);
								<?php else : ?>
									$( '[id="customize-control-<?php echo $control['setting']; ?>"]' ).fadeOut(300);
								<?php endif; ?>
							<?php endif; ?>

							$( "#input_<?php echo $id; ?> input" ).each(function(){
								$(this).click(function(){
									if ( $(this).val() == "<?php echo $value; ?>" ) {
										$( '[id="customize-control-<?php echo $control['setting']; ?>"]' ).fadeIn(300);
									} else {
										$( '[id="customize-control-<?php echo $control['setting']; ?>"]' ).fadeOut(300);
									}
								});
								if ( $(this).val() == "<?php echo $value; ?>" ) {
										$( '[id="customize-control-<?php echo $control['setting']; ?>"]' ).fadeIn(300);
									} else {
										$( '[id="customize-control-<?php echo $control['setting']; ?>"]' ).fadeOut(300);
									}
							});
						});
					</script>
					<?php

				endforeach;

			}

		}

	}

}
add_action( 'customize_controls_print_footer_scripts', 'kirki_required_script' );<commit_msg>Fix required setting.<commit_after><?php

/**
 * Add the required script.
 */
function kirki_required_script() {

	$controls = apply_filters( 'kirki/controls', array() );

	if ( isset( $controls ) ) {

		foreach ( $controls as $control ) {

			if ( isset( $control['required'] ) && ! is_null( $control['required'] && is_array( $control['required'] ) ) ) {

				foreach ( $control['required'] as $id => $value ) : ?>

					<script>
						jQuery(document).ready(function($) {
							<?php if ( isset( $id ) && isset( $value ) ) : ?>
							 	<?php if ( $value == get_theme_mod( $id ) ) : ?>
									$( '[id="customize-control-<?php echo $control['setting']; ?>_opacity"]' ).fadeIn(300);
								<?php else : ?>
									$( '[id="customize-control-<?php echo $control['setting']; ?>_opacity"]' ).fadeOut(300);
								<?php endif; ?>
							<?php endif; ?>

							$( "#input_<?php echo $id; ?> input" ).each(function(){
								$(this).click(function(){
									if ( $(this).val() == "<?php echo $value; ?>" ) {
										$( '[id="customize-control-<?php echo $control['setting']; ?>_opacity"]' ).fadeIn(300);
									} else {
										$( '[id="customize-control-<?php echo $control['setting']; ?>_opacity"]' ).fadeOut(300);
									}
								});
								if ( $(this).val() == "<?php echo $value; ?>" ) {
										$( '[id="customize-control-<?php echo $control['setting']; ?>_opacity"]' ).fadeIn(300);
									} else {
										$( '[id="customize-control-<?php echo $control['setting']; ?>_opacity"]' ).fadeOut(300);
									}
							});
						});
					</script>
					<?php

				endforeach;

			}

		}

	}

}
add_action( 'customize_controls_print_footer_scripts', 'kirki_required_script' );
{'fraction_non_alphanumeric': 0.23097663271420013, 'fraction_numerical': 0.01078490113840623, 'mean_word_length': 2.6935840707964602, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '3703219', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1076, 'n_words': 202}