PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.2
Elementor Website Builder – more than just a page builder v4.2.2
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 / controls / section.php

section.php in Elementor Website Builder – more than just a page builder 4.2.2, at modules/atomic-widgets/controls/section.php

74 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\AtomicWidgets\Controls;
3
4 use JsonSerializable;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 class Section implements JsonSerializable {
11 private ?string $id = null;
12 private $label = null;
13 private $description = null;
14 private array $items = [];
15
16 public static function make(): self {
17 return new static();
18 }
19
20 public function set_id( string $id ): self {
21 $this->id = $id;
22
23 return $this;
24 }
25
26 public function get_id() {
27 return $this->id;
28 }
29
30 public function set_label( string $label ): self {
31 $this->label = html_entity_decode( $label );
32
33 return $this;
34 }
35
36 public function get_label(): ?string {
37 return $this->label;
38 }
39
40 public function set_description( string $description ): self {
41 $this->description = html_entity_decode( $description );
42
43 return $this;
44 }
45
46 public function set_items( array $items ): self {
47 $this->items = $items;
48
49 return $this;
50 }
51
52 public function add_item( $item ): self {
53 $this->items[] = $item;
54
55 return $this;
56 }
57
58 public function get_items() {
59 return $this->items;
60 }
61
62 public function jsonSerialize(): array {
63 return [
64 'type' => 'section',
65 'value' => [
66 'id' => $this->id,
67 'label' => $this->label,
68 'description' => $this->description,
69 'items' => $this->items,
70 ],
71 ];
72 }
73 }
74