# elementor/3.32.2/modules/variables/transformers/global-variable-transformer.php

Elementor Website Builder – more than just a page builder, version 3.32.2. 33 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.32.2/code/modules/variables/transformers/global-variable-transformer.php
- Raw: https://pluginprobe.com/plugins/elementor/3.32.2/raw/modules/variables/transformers/global-variable-transformer.php
- Modified: 2025-08-05T14:00:00+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/3.32.2/code/modules/variables/transformers/global-variable-transformer.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\Variables\Transformers;

use Elementor\Modules\Variables\Classes\Variables;
use Elementor\Modules\AtomicWidgets\PropsResolver\Transformer_Base;

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

class Global_Variable_Transformer extends Transformer_Base {
	public function transform( $value, $key ) {
		$variable = Variables::by_id( $value );

		if ( ! $variable ) {
			return null;
		}

		if ( array_key_exists( 'deleted', $variable ) && $variable['deleted'] ) {
			return "var(--{$value})";
		}

		$identifier = $variable['label'];

		if ( ! trim( $identifier ) ) {
			return null;
		}

		return "var(--{$identifier})";
	}
}

```
