Automattic\WooCommerce\Admin\Features\Settings
Transformer::transform
Transform settings data.
Method of the class: Transformer{}
No Hooks.
Returns
Array. Transformed settings data.
Usage
$Transformer = new Transformer(); $Transformer->transform( $raw_settings ): array;
- $raw_settings(array) (required)
- Raw settings data.
Transformer::transform() Transformer::transform code WC 10.5.0
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;
}