| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Variables\Classes; |
| 4 |
|
| 5 |
use Elementor\Modules\Variables\Storage\Repository as Variables_Repository; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly. |
| 9 |
} |
| 10 |
|
| 11 |
class Variables { |
| 12 |
private static $lookup = []; |
| 13 |
|
| 14 |
public static function init( Variables_Repository $repository ) { |
| 15 |
self::$lookup = $repository->variables(); |
| 16 |
} |
| 17 |
|
| 18 |
public static function by_id( string $id ) { |
| 19 |
return self::$lookup[ $id ] ?? null; |
| 20 |
} |
| 21 |
} |
| 22 |
|