PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev3
Elementor Website Builder – more than just a page builder v3.28.0-dev3
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 / atomic-widget-base.php

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

52 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\Elements;
3
4 use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Prop_Type;
5 use Elementor\Widget_Base;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 abstract class Atomic_Widget_Base extends Widget_Base {
12 use Has_Atomic_Base;
13
14 protected $version = '0.0';
15 protected $styles = [];
16
17 public function __construct( $data = [], $args = null ) {
18 parent::__construct( $data, $args );
19
20 $this->version = $data['version'] ?? '0.0';
21 $this->styles = $data['styles'] ?? [];
22 }
23
24 abstract protected function define_atomic_controls(): array;
25
26 final public function get_initial_config() {
27 $config = parent::get_initial_config();
28
29 $config['atomic'] = true;
30 $config['atomic_controls'] = $this->get_atomic_controls();
31 $config['base_styles'] = $this->get_base_styles();
32 $config['atomic_props_schema'] = static::get_props_schema();
33 $config['version'] = $this->version;
34
35 return $config;
36 }
37
38 public function get_categories(): array {
39 return [ 'v4-elements' ];
40 }
41 /**
42 * TODO: Removes the wrapper div from the widget.
43 */
44 public function before_render() {}
45 public function after_render() {}
46
47 /**
48 * @return array<string, Prop_Type>
49 */
50 abstract protected static function define_props_schema(): array;
51 }
52