PluginProbe
Elementor Website Builder – more than just a page builder / 3.29.2
Elementor Website Builder – more than just a page builder v3.29.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 3.29.2, at modules/atomic-widgets/controls/section.php

58 lines 1020 B
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 $label = null;
12 private $description = null;
13 private array $items = [];
14
15 public static function make(): self {
16 return new static();
17 }
18
19 public function set_label( string $label ): self {
20 $this->label = $label;
21
22 return $this;
23 }
24
25 public function set_description( string $description ): self {
26 $this->description = $description;
27
28 return $this;
29 }
30
31 public function set_items( array $items ): self {
32 $this->items = $items;
33
34 return $this;
35 }
36
37 public function add_item( $item ): self {
38 $this->items[] = $item;
39
40 return $this;
41 }
42
43 public function get_items() {
44 return $this->items;
45 }
46
47 public function jsonSerialize(): array {
48 return [
49 'type' => 'section',
50 'value' => [
51 'label' => $this->label,
52 'description' => $this->description,
53 'items' => $this->items,
54 ],
55 ];
56 }
57 }
58