PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.0-dev5
Elementor Website Builder – more than just a page builder v3.26.0-dev5
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
← All changes | modules/atomic-widgets/base/atomic-control-base.php +47 -6 4.1.43.26.0-dev5 View file →
@@ -1,15 +1,56 @@
1 1 <?php
2 2
3 3 namespace Elementor\Modules\AtomicWidgets\Base;
4 4
5 -use Elementor\Modules\AtomicWidgets\Controls\Base\Atomic_Control_Base as New_Atomic_Control_Base;
5 +use JsonSerializable;
6 6
7 7 if ( ! defined( 'ABSPATH' ) ) {
8 8 exit; // Exit if accessed directly.
9 9 }
10 10
11 -// TODO: Remove this class after 3.36 is released.
12 -/**
13 - * @deprecated 3.34 Use \Elementor\Modules\AtomicWidgets\Controls\Base\Atomic_Control_Base instead.
14 - */
15 -abstract class Atomic_Control_Base extends New_Atomic_Control_Base {}
11 +abstract class Atomic_Control_Base implements JsonSerializable {
12 + private string $bind;
13 + private $label = null;
14 + private $description = null;
15 +
16 + abstract public function get_type(): string;
17 +
18 + abstract public function get_props(): array;
19 +
20 + public static function bind_to( string $prop_name ) {
21 + return new static( $prop_name );
22 + }
23 +
24 + protected function __construct( string $prop_name ) {
25 + $this->bind = $prop_name;
26 + }
27 +
28 + public function get_bind() {
29 + return $this->bind;
30 + }
31 +
32 + public function set_label( string $label ): self {
33 + $this->label = $label;
34 +
35 + return $this;
36 + }
37 +
38 + public function set_description( string $description ): self {
39 + $this->description = $description;
40 +
41 + return $this;
42 + }
43 +
44 + public function jsonSerialize(): array {
45 + return [
46 + 'type' => 'control',
47 + 'value' => [
48 + 'type' => $this->get_type(),
49 + 'bind' => $this->get_bind(),
50 + 'label' => $this->label,
51 + 'description' => $this->description,
52 + 'props' => $this->get_props(),
53 + ],
54 + ];
55 + }
56 +}