packages/kirki-framework/core/src/Field.php
protected function set_settings() {

		// If settings is not an array, temporarily convert it to an array.
		// This is just to allow us to process everything the same way and avoid code duplication.
		// if settings is not an array then it will not be set as an array in the end.
		if ( ! is_array( $this->settings ) ) {
			$this->settings = [
				'kirki_placeholder_setting' => $this->settings,
			];
		}
		$settings = [];
		foreach ( $this->settings as $setting_key => $setting_value ) {
			$settings[ $setting_key ] = $setting_value;

			// If we're using serialized options then we need to spice this up.
			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
				$settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]";
			}
		}
		$this->settings = $settings;
		if ( isset( $this->settings['kirki_placeholder_setting'] ) ) {
			$this->settings = $this->settings['kirki_placeholder_setting'];
		}
	}
protected function set_settings() {

		// If settings is not an array, temporarily convert it to an array.
		// This is just to allow us to process everything the same way and avoid code duplication.
		// if settings is not an array then it will not be set as an array in the end.
		if ( ! is_array( $this->settings ) ) {
			$this->settings = [
				'kirki_placeholder_setting' => $this->settings,
			];
		}
		$settings = [];
		foreach ( $this->settings as $setting_key => $setting_value ) {
			$settings[ $setting_key ] = $setting_value;

			// If we're using serialized options then we need to spice this up.
			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
				$settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]";
			}
		}
		$this->settings = $settings;
		if ( isset( $this->settings['kirki_placeholder_setting'] ) ) {
			$this->settings = $this->settings['kirki_placeholder_setting'];
		}
	}
protected function set_settings ( ) { // If settings is not an array, temporarily convert it to an array. // This is just to allow us to process everything the same way and avoid code duplication. // if settings is not an array then it will not be set as an array in the end. if ( ! is_array ( $ this -> settings ) ) { $ this -> settings = [ 'kirki_placeholder_setting' => $ this -> settings , ] ; } $ settings = [ ] ; foreach ( $ this -> settings as $ setting_key => $ setting_value ) { $ settings [ $ setting_key ] = $ setting_value ; // If we're using serialized options then we need to spice this up. if ( 'option' === $ this -> option_type && '' !== $ this -> option_name && ( false === strpos ( $ setting_key , '[' ) ) ) { $ settings [ $ setting_key ] = "{$this->option_name}[{$setting_value}]" ; } } $ this -> settings = $ settings ; if ( isset ( $ this -> settings [ 'kirki_placeholder_setting' ] ) ) { $ this -> settings = $ this -> settings [ 'kirki_placeholder_setting' ] ; } }
Sets the settings.
If we're using serialized options it makes sure that settings are properly formatted.
We'll also be escaping all setting names here for consistency.

@access protected
Sets the settings . If we re using serialized options it makes sure that settings are properly formatted . We ll also be escaping all setting names here for consistency .