PHP 8.2.31
Preview: global-variable-transformer.php Size: 684 B
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/elementor/modules/variables/transformers/global-variable-transformer.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})";
	}
}

Directory Contents

Dirs: 0 × Files: 1

Name Size Perms Modified Actions
684 B lrw-r--r-- 2025-08-05 18:00:00
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).