PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.4
Elementor Website Builder – more than just a page builder v4.2.4
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 / atomic-widgets / elements / base / widget-builder.php

widget-builder.php in Elementor Website Builder – more than just a page builder 4.2.4, at modules/atomic-widgets/elements/base/widget-builder.php

56 lines 1.1 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\Elements\Base;
4
5 class Widget_Builder {
6 protected $widget_type;
7 protected $settings = [];
8 protected $is_locked = false;
9 protected $editor_settings = [];
10 protected $meta = [];
11
12 public static function make( string $widget_type ) {
13 return new self( $widget_type );
14 }
15
16 private function __construct( string $widget_type ) {
17 $this->widget_type = $widget_type;
18 }
19
20 public function settings( array $settings ) {
21 $this->settings = $settings;
22 return $this;
23 }
24
25 public function is_locked( $is_locked ) {
26 $this->is_locked = $is_locked;
27 return $this;
28 }
29
30 public function editor_settings( array $editor_settings ) {
31 $this->editor_settings = $editor_settings;
32 return $this;
33 }
34
35 public function meta( array $meta ) {
36 $this->meta = $meta;
37 return $this;
38 }
39
40 public function build() {
41 $widget_data = [
42 'elType' => 'widget',
43 'widgetType' => $this->widget_type,
44 'settings' => $this->settings,
45 'isLocked' => $this->is_locked,
46 'editor_settings' => $this->editor_settings,
47 ];
48
49 if ( ! empty( $this->meta ) ) {
50 $widget_data['meta'] = $this->meta;
51 }
52
53 return $widget_data;
54 }
55 }
56