Automattic\WooCommerce\Admin\Features\Settings

Transformer::process_setting()privateWC 1.0

Process individual setting.

Method of the class: Transformer{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->process_setting( $setting, $transformed_settings ): void;
$setting(array) (required)
Setting to process.
$transformed_settings(array) (required)
Transformed settings array.

Transformer::process_setting() code WC 9.7.1

private function process_setting( array $setting, array &$transformed_settings ): void {
	$type = $setting['type'] ?? '';

	if ( $this->current_checkbox_group && 'checkbox' !== $type ) {
		// It's expected that a checkbox group will always be closed before a non-checkbox setting.
		// If not, it's likely a checkbox group was not closed properly so we flush the current checkbox group and add the setting as-is.
		$this->flush_current_checkbox_group();
	}

	switch ( $type ) {
		case 'title':
			$this->handle_group_start( $setting, $transformed_settings );
			break;

		case 'sectionend':
			$this->handle_group_end( $setting, $transformed_settings );
			break;

		case 'checkbox':
			$this->handle_checkbox_setting( $setting, $transformed_settings );
			break;

		default:
			$this->add_setting( $setting, $transformed_settings );
			break;
	}
}