PluginProbe
Elementor Website Builder – more than just a page builder / 3.24.4
Elementor Website Builder – more than just a page builder v3.24.4
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 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | modules/atomic-widgets/base/atomic-control-base.php +46 -9 4.1.0-dev23.24.4 View file →
@@ -1,15 +1,52 @@
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 -if ( ! defined( 'ABSPATH' ) ) {
8 - exit; // Exit if accessed directly.
7 +abstract class Atomic_Control_Base implements JsonSerializable {
8 + private string $bind;
9 + private $label = null;
10 + private $description = null;
11 +
12 + abstract public function get_type(): string;
13 +
14 + abstract public function get_props(): array;
15 +
16 + public static function bind_to( string $prop_name ) {
17 + return new static( $prop_name );
18 + }
19 +
20 + protected function __construct( string $prop_name ) {
21 + $this->bind = $prop_name;
22 + }
23 +
24 + public function get_bind() {
25 + return $this->bind;
26 + }
27 +
28 + public function set_label( string $label ): self {
29 + $this->label = $label;
30 +
31 + return $this;
32 + }
33 +
34 + public function set_description( string $description ): self {
35 + $this->description = $description;
36 +
37 + return $this;
38 + }
39 +
40 + public function jsonSerialize(): array {
41 + return [
42 + 'type' => 'control',
43 + 'value' => [
44 + 'type' => $this->get_type(),
45 + 'bind' => $this->get_bind(),
46 + 'label' => $this->label,
47 + 'description' => $this->description,
48 + 'props' => $this->get_props(),
49 + ],
50 + ];
51 + }
9 52 }
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 {}