Automattic\WooCommerce\Admin\Features\Settings

Transformer::transform()publicWC 1.0

Transform settings data.

Method of the class: Transformer{}

No Hooks.

Return

Array. Transformed settings data.

Usage

$Transformer = new Transformer();
$Transformer->transform( $raw_settings ): array;
$raw_settings(array) (required)
Raw settings data.

Transformer::transform() code WC 9.7.1

public function transform( array $raw_settings ): array {
	$transformed = array();

	foreach ( $raw_settings as $tab_id => $tab ) {
		// If the tab doesn't have sections, or the sections aren't an array, skip it.
		if ( ! isset( $tab['sections'] ) || ! is_array( $tab['sections'] ) ) {
			$transformed[ $tab_id ] = $tab;
			continue;
		}

		$transformed[ $tab_id ]             = $tab;
		$transformed[ $tab_id ]['sections'] = $this->transform_sections( $tab['sections'] );
	}

	return $transformed;
}