# elementor/4.2.0/modules/variables/classes/variables.php

Elementor Website Builder – more than just a page builder, version 4.2.0. 23 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.2.0/code/modules/variables/classes/variables.php
- Raw: https://pluginprobe.com/plugins/elementor/4.2.0/raw/modules/variables/classes/variables.php
- Modified: 2025-12-22T12:25:58+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.2.0/code/modules/variables/classes/variables.php#L10-L20`.

```php
<?php

namespace Elementor\Modules\Variables\Classes;

use Elementor\Modules\Variables\Services\Variables_Service;
use Elementor\Modules\Variables\Storage\Repository as Variables_Repository;

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

class Variables {
	private static $lookup = [];

	public static function init( Variables_Service $service ) {
		self::$lookup = $service->get_variables_list();
	}

	public static function by_id( string $id ) {
		return self::$lookup[ $id ] ?? null;
	}
}

```
