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

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

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