PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.1
Elementor Website Builder – more than just a page builder v4.3.1
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
elementor / modules / atomic-widgets / css-converter / converters / rejected-converter.php

rejected-converter.php in Elementor Website Builder – more than just a page builder 4.3.1, at modules/atomic-widgets/css-converter/converters/rejected-converter.php

35 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\AtomicWidgets\CssConverter\Converters;
4
5 use Elementor\Modules\AtomicWidgets\CssConverter\Conversion_Context;
6 use Elementor\Modules\AtomicWidgets\CssConverter\Property_Converter_Base;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Claims a property and unconditionally rejects it: the declaration is added to the `rejected`
14 * bucket instead of `customCss`. Used for properties that are structurally incompatible with
15 * Elementor's style system (e.g. `animation`, `@keyframes`), so the client can surface a hint
16 * to the LLM rather than silently emitting broken CSS.
17 */
18 class Rejected_Converter extends Property_Converter_Base {
19 private string $property;
20
21 public function __construct( string $property ) {
22 $this->property = $property;
23 }
24
25 protected function get_supported_properties(): array {
26 return [ $this->property ];
27 }
28
29 protected function do_convert( Conversion_Context $context, array $rule ): bool {
30 $context->reject( $rule['declaration'] . ';' );
31
32 return true;
33 }
34 }
35