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 / string-value.php

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

30 lines 634 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 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class String_Value {
10 public static function is_valid( $prop_value, $allowed_values = null ) {
11 if ( ! is_array( $prop_value ) ) {
12 return false;
13 }
14
15 if ( ! isset( $prop_value['$$type'] ) || 'string' !== $prop_value['$$type'] ) {
16 return false;
17 }
18
19 if ( ! isset( $prop_value['value'] ) || ! is_string( $prop_value['value'] ) ) {
20 return false;
21 }
22
23 if ( null !== $allowed_values && ! in_array( $prop_value['value'], $allowed_values, true ) ) {
24 return false;
25 }
26
27 return true;
28 }
29 }
30