packages/kirki-framework/module-css/src/Module.php
public static function loop_controls( $config_id ) {

		// Get an instance of the Generator class.
		// This will make sure google fonts and backup fonts are loaded.
		Generator::get_instance();

		$fields = array_merge( Kirki::$fields, self::get_fields_by_config( $config_id ) );
		$css    = [];

		// Early exit if no fields are found.
		if ( empty( $fields ) ) {
			return;
		}

		foreach ( $fields as $field ) {

			// Only process fields that belong to $config_id.
			if ( isset( $field['kirki_config'] ) && $config_id !== $field['kirki_config'] ) {
				continue;
			}

			if ( true === apply_filters( "kirki_{$config_id}_css_skip_hidden", true ) ) {

				// Only continue if field dependencies are met.
				if ( ! empty( $field['required'] ) ) {
					$valid = true;

					foreach ( $field['required'] as $requirement ) {
						if ( isset( $requirement['setting'] ) && isset( $requirement['value'] ) && isset( $requirement['operator'] ) ) {
							$controller_value = Values::get_value( $config_id, $requirement['setting'] );
							if ( ! Helper::compare_values( $controller_value, $requirement['value'], $requirement['operator'] ) ) {
								$valid = false;
							}
						}
					}

					if ( ! $valid ) {
						continue;
					}
				}
			}

			// Only continue if $field['output'] is set.
			if ( isset( $field['output'] ) && ! empty( $field['output'] ) ) {
				$css = Helper::array_replace_recursive( $css, Generator::css( $field ) );

				// Add the globals.
				if ( isset( self::$css_array[ $config_id ] ) && ! empty( self::$css_array[ $config_id ] ) ) {
					Helper::array_replace_recursive( $css, self::$css_array[ $config_id ] );
				}
			}
		}

		$css = apply_filters( "kirki_{$config_id}_styles", $css );

		if ( is_array( $css ) ) {
			return Generator::styles_parse( Generator::add_prefixes( $css ) );
		}
	}
public static function loop_controls( $config_id ) {

		// Get an instance of the Generator class.
		// This will make sure google fonts and backup fonts are loaded.
		Generator::get_instance();

		$fields = array_merge( Kirki::$fields, self::get_fields_by_config( $config_id ) );
		$css    = [];

		// Early exit if no fields are found.
		if ( empty( $fields ) ) {
			return;
		}

		foreach ( $fields as $field ) {

			// Only process fields that belong to $config_id.
			if ( isset( $field['kirki_config'] ) && $config_id !== $field['kirki_config'] ) {
				continue;
			}

			if ( true === apply_filters( "kirki_{$config_id}_css_skip_hidden", true ) ) {

				// Only continue if field dependencies are met.
				if ( ! empty( $field['required'] ) ) {
					$valid = true;

					foreach ( $field['required'] as $requirement ) {
						if ( isset( $requirement['setting'] ) && isset( $requirement['value'] ) && isset( $requirement['operator'] ) ) {
							$controller_value = Values::get_value( $config_id, $requirement['setting'] );
							if ( ! Helper::compare_values( $controller_value, $requirement['value'], $requirement['operator'] ) ) {
								$valid = false;
							}
						}
					}

					if ( ! $valid ) {
						continue;
					}
				}
			}

			// Only continue if $field['output'] is set.
			if ( isset( $field['output'] ) && ! empty( $field['output'] ) ) {
				$css = Helper::array_replace_recursive( $css, Generator::css( $field ) );

				// Add the globals.
				if ( isset( self::$css_array[ $config_id ] ) && ! empty( self::$css_array[ $config_id ] ) ) {
					Helper::array_replace_recursive( $css, self::$css_array[ $config_id ] );
				}
			}
		}

		$css = apply_filters( "kirki_{$config_id}_styles", $css );

		if ( is_array( $css ) ) {
			return Generator::styles_parse( Generator::add_prefixes( $css ) );
		}
	}
public static function loop_controls ( $ config_id ) { // Get an instance of the Generator class. // This will make sure google fonts and backup fonts are loaded. Generator :: get_instance ( ) ; $ fields = array_merge ( Kirki :: $ fields , self :: get_fields_by_config ( $ config_id ) ) ; $ css = [ ] ; // Early exit if no fields are found. if ( empty ( $ fields ) ) { return ; } foreach ( $ fields as $ field ) { // Only process fields that belong to $config_id. if ( isset ( $ field [ 'kirki_config' ] ) && $ config_id !== $ field [ 'kirki_config' ] ) { continue ; } if ( true === apply_filters ( "kirki_{$config_id}_css_skip_hidden" , true ) ) { // Only continue if field dependencies are met. if ( ! empty ( $ field [ 'required' ] ) ) { $ valid = true ; foreach ( $ field [ 'required' ] as $ requirement ) { if ( isset ( $ requirement [ 'setting' ] ) && isset ( $ requirement [ 'value' ] ) && isset ( $ requirement [ 'operator' ] ) ) { $ controller_value = Values :: get_value ( $ config_id , $ requirement [ 'setting' ] ) ; if ( ! Helper :: compare_values ( $ controller_value , $ requirement [ 'value' ] , $ requirement [ 'operator' ] ) ) { $ valid = false ; } } } if ( ! $ valid ) { continue ; } } } // Only continue if $field['output'] is set. if ( isset ( $ field [ 'output' ] ) && ! empty ( $ field [ 'output' ] ) ) { $ css = Helper :: array_replace_recursive ( $ css , Generator :: css ( $ field ) ) ; // Add the globals. if ( isset ( self :: $ css_array [ $ config_id ] ) && ! empty ( self :: $ css_array [ $ config_id ] ) ) { Helper :: array_replace_recursive ( $ css , self :: $ css_array [ $ config_id ] ) ; } } } $ css = apply_filters ( "kirki_{$config_id}_styles" , $ css ) ; if ( is_array ( $ css ) ) { return Generator :: styles_parse ( Generator :: add_prefixes ( $ css ) ) ; } }
Loop through all fields and create an array of style definitions.

@static
@access public
@param string $config_id The configuration ID.
Loop through all fields and create an array of style definitions .