# elementor/4.1.0-beta3/modules/global-classes/utils/global-class-data-normalizer.php

Elementor Website Builder – more than just a page builder, version 4.1.0-beta3. 43 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.1.0-beta3/code/modules/global-classes/utils/global-class-data-normalizer.php
- Raw: https://pluginprobe.com/plugins/elementor/4.1.0-beta3/raw/modules/global-classes/utils/global-class-data-normalizer.php
- Modified: 2026-05-20T12:19:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/4.1.0-beta3/code/modules/global-classes/utils/global-class-data-normalizer.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\GlobalClasses\Utils;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Global_Class_Data_Normalizer {
	public static function normalize_styles( array $raw_items ): array {
		$normalized = [];

		foreach ( $raw_items as $class_id => $class_data ) {
			$normalized[ $class_id ] = self::normalize_style( $class_id, $class_data );
		}

		return $normalized;
	}

	public static function normalize_style( string $class_id, array $class_data ): array {
		return array_merge(
			[
				'id' => $class_id,
				'label' => $class_data['label'] ?? $class_id,
			],
			self::normalize_style_fields( $class_data )
		);
	}

	public static function normalize_style_fields( array $item ): array {
		$data = [
			'type' => $item['type'] ?? 'class',
			'variants' => $item['variants'] ?? [],
		];

		if ( array_key_exists( 'sync_to_v3', $item ) ) {
			$data['sync_to_v3'] = (bool) $item['sync_to_v3'];
		}

		return $data;
	}
}

```
