Automattic\WooCommerce\Admin\Features\Settings
Transformer::transform_sections
Transform sections within a tab.
Method of the class: Transformer{}
No Hooks.
Returns
Array. Transformed sections.
Usage
// private - for code of main (parent) class only $result = $this->transform_sections( $sections ): array;
- $sections(array) (required)
- Sections to transform.
Transformer::transform_sections() Transformer::transform sections code WC 10.3.6
private function transform_sections( array $sections ): array {
$transformed_sections = array();
foreach ( $sections as $section_id => $section ) {
// If the section doesn't have settings, or the settings aren't an array, skip it.
if ( ! isset( $section['settings'] ) || ! is_array( $section['settings'] ) ) {
$transformed_sections[ $section_id ] = $section;
continue;
}
$transformed_sections[ $section_id ] = $section;
$transformed_sections[ $section_id ]['settings'] = $this->transform_section_settings( $section['settings'] );
}
return $transformed_sections;
}