PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
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 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / interactions / validators / custom-effect-value.php

custom-effect-value.php in Elementor Website Builder – more than just a page builder 4.2.0, at modules/interactions/validators/custom-effect-value.php

36 lines 851 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\Interactions\Validators;
4
5 use Elementor\Modules\AtomicWidgets\Parsers\Props_Parser;
6 use Elementor\Modules\Interactions\Props\Custom_Effect_Prop_Type;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 /**
13 * TODO: At least a value validator interface to enforce is_valid fxn for consistency
14 */
15 class Custom_Effect_Value {
16 public static function is_valid( array $animation_value ): bool {
17 $effect_value = $animation_value['effect']['value'] ?? null;
18
19 if ( 'custom' !== $effect_value ) {
20 return true;
21 }
22
23 if ( ! isset( $animation_value['custom_effect'] ) ) {
24 return false;
25 }
26
27 $props_parser = Props_Parser::make( [
28 'custom_effect' => Custom_Effect_Prop_Type::make(),
29 ] );
30
31 $result = $props_parser->parse( [ 'custom_effect' => $animation_value['custom_effect'] ] );
32
33 return $result->is_valid();
34 }
35 }
36