| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Modules\Variables\Classes; |
| 4 | 4 | |
| 5 | -use Elementor\Modules\Variables\Services\Variables_Service; | |
| 5 | +use Elementor\Modules\Variables\Storage\Repository as Variables_Repository; | |
| 6 | 6 | |
| 7 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | 8 | exit; // Exit if accessed directly. |
| 9 | 9 | } |
| @@ -8,16 +8,16 @@ | ||
| 8 | 8 | exit; // Exit if accessed directly. |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | class CSS_Renderer { |
| 12 | - private Variables_Service $service; | |
| 12 | + private Variables_Repository $repository; | |
| 13 | 13 | |
| 14 | - public function __construct( Variables_Service $service ) { | |
| 15 | - $this->service = $service; | |
| 14 | + public function __construct( Variables_Repository $repository ) { | |
| 15 | + $this->repository = $repository; | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | private function global_variables(): array { |
| 19 | - return $this->service->get_variables_list(); | |
| 19 | + return $this->repository->variables(); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function raw_css(): string { |
| 23 | 23 | $list_of_variables = $this->global_variables(); |
| @@ -53,9 +53,9 @@ | ||
| 53 | 53 | |
| 54 | 54 | private function build_css_variable_entry( string $id, array $variable ): ?string { |
| 55 | 55 | $variable_name = sanitize_text_field( $id ); |
| 56 | 56 | |
| 57 | - if ( ! array_key_exists( 'deleted_at', $variable ) ) { | |
| 57 | + if ( ! array_key_exists( 'deleted', $variable ) ) { | |
| 58 | 58 | $variable_name = sanitize_text_field( $variable['label'] ?? '' ); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $value = sanitize_text_field( $variable['value'] ?? '' ); |
| @@ -63,13 +63,9 @@ | ||
| 63 | 63 | if ( empty( $value ) || empty( $variable_name ) ) { |
| 64 | 64 | return null; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $entry = "--{$variable_name}:{$value};"; | |
| 68 | - | |
| 69 | - $additional = apply_filters( 'elementor/variables/css_entry_additional', '', $variable, $id ); | |
| 70 | - | |
| 71 | - return $entry . $additional; | |
| 67 | + return "--{$variable_name}:{$value};"; | |
| 72 | 68 | } |
| 73 | 69 | |
| 74 | 70 | private function wrap_with_root( array $css_entries ): string { |
| 75 | 71 | return ':root { ' . implode( ' ', $css_entries ) . ' }'; |