PluginProbe
Elementor Website Builder – more than just a page builder / 3.31.4
Elementor Website Builder – more than just a page builder v3.31.4
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-element-base.php

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

73 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\AtomicWidgets\Elements;
4
5 use Elementor\Element_Base;
6 use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
7 use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Prop_Type;
8 use Elementor\Plugin;
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly.
12 }
13
14 abstract class Atomic_Element_Base extends Element_Base {
15
16 use Has_Atomic_Base;
17
18 protected $version = '0.0';
19 protected $styles = [];
20 protected $editor_settings = [];
21
22 public function __construct( $data = [], $args = null ) {
23 parent::__construct( $data, $args );
24
25 $this->version = $data['version'] ?? '0.0';
26 $this->styles = $data['styles'] ?? [];
27 $this->editor_settings = $data['editor_settings'] ?? [];
28 }
29
30 abstract protected function define_atomic_controls(): array;
31
32 public function get_global_scripts() {
33 return [];
34 }
35
36 final public function get_initial_config() {
37 $config = parent::get_initial_config();
38 $props_schema = static::get_props_schema();
39
40 $config['atomic_controls'] = $this->get_atomic_controls();
41 $config['atomic_props_schema'] = $props_schema;
42 $config['dependencies_per_target_mapping'] = Dependency_Manager::get_source_to_dependents( $props_schema );
43 $config['base_styles'] = $this->get_base_styles();
44 $config['version'] = $this->version;
45 $config['show_in_panel'] = true;
46 $config['categories'] = [ 'v4-elements' ];
47 $config['hide_on_search'] = false;
48 $config['controls'] = [];
49 $config['keywords'] = $this->get_keywords();
50
51 return $config;
52 }
53
54 /**
55 * @return array<string, Prop_Type>
56 */
57 abstract protected static function define_props_schema(): array;
58
59 /**
60 * Get Element keywords.
61 *
62 * Retrieve the element keywords.
63 *
64 * @since 3.29
65 * @access public
66 *
67 * @return array Element keywords.
68 */
69 public function get_keywords() {
70 return [];
71 }
72 }
73