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 / plain-resolvers / resolvers / html-v3-plain-resolver.php

html-v3-plain-resolver.php in Elementor Website Builder – more than just a page builder 4.3.1, at modules/atomic-widgets/plain-resolvers/resolvers/html-v3-plain-resolver.php

55 lines 1.2 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\PlainResolvers\Resolvers;
4
5 use Elementor\Modules\AtomicWidgets\PlainResolvers\Plain_Resolver_Base;
6 use Elementor\Modules\AtomicWidgets\PlainResolvers\Plain_Values_Resolver;
7 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class Html_V3_Plain_Resolver extends Plain_Resolver_Base {
14 private Plain_Values_Resolver $walker;
15
16 public function __construct( Plain_Values_Resolver $walker ) {
17 $this->walker = $walker;
18 }
19
20 public function resolve( $plain_value ) {
21 if ( ! is_array( $plain_value ) ) {
22 return null;
23 }
24
25 $converted = [];
26
27 if ( array_key_exists( 'content', $plain_value ) ) {
28 $resolved_content = $this->walker->resolve(
29 $plain_value['content'],
30 String_Prop_Type::make()
31 );
32
33 if ( null === $resolved_content ) {
34 return null;
35 }
36
37 $converted['content'] = $resolved_content;
38 }
39
40 if ( array_key_exists( 'children', $plain_value ) ) {
41 if ( ! is_array( $plain_value['children'] ) ) {
42 return null;
43 }
44
45 $converted['children'] = $plain_value['children'];
46 }
47
48 if ( empty( $converted ) ) {
49 return null;
50 }
51
52 return $converted;
53 }
54 }
55