PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.0
Elementor Website Builder – more than just a page builder v3.30.0
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.30.0, at modules/atomic-widgets/elements/atomic-widget-base.php

59 lines 1.5 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 protected $editor_settings = [];
17
18 public function __construct( $data = [], $args = null ) {
19 parent::__construct( $data, $args );
20
21 $this->version = $data['version'] ?? '0.0';
22 $this->styles = $data['styles'] ?? [];
23 $this->editor_settings = $data['editor_settings'] ?? [];
24 }
25
26 abstract protected function define_atomic_controls(): array;
27
28 public function get_global_scripts() {
29 return [];
30 }
31
32 public function get_initial_config() {
33 $config = parent::get_initial_config();
34
35 $config['atomic'] = true;
36 $config['atomic_controls'] = $this->get_atomic_controls();
37 $config['base_styles'] = $this->get_base_styles();
38 $config['base_styles_dictionary'] = $this->get_base_styles_dictionary();
39 $config['atomic_props_schema'] = static::get_props_schema();
40 $config['version'] = $this->version;
41
42 return $config;
43 }
44
45 public function get_categories(): array {
46 return [ 'v4-elements' ];
47 }
48 /**
49 * TODO: Removes the wrapper div from the widget.
50 */
51 public function before_render() {}
52 public function after_render() {}
53
54 /**
55 * @return array<string, Prop_Type>
56 */
57 abstract protected static function define_props_schema(): array;
58 }
59