PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.3
Elementor Website Builder – more than just a page builder v3.34.3
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 / components / widgets / component-instance.php

component-instance.php in Elementor Website Builder – more than just a page builder 3.34.3, at modules/components/widgets/component-instance.php

61 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\Components\Widgets;
3
4 use Elementor\Modules\AtomicWidgets\Elements\Atomic_Widget_Base;
5 use Elementor\Modules\AtomicWidgets\Elements\Has_Template;
6 use Elementor\Modules\Components\PropTypes\Component_Instance_Prop_Type;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 class Component_Instance extends Atomic_Widget_Base {
13 use Has_Template;
14
15 public static function get_element_type(): string {
16 return 'e-component';
17 }
18
19 public function show_in_panel() {
20 return false;
21 }
22
23 public function get_title() {
24 return esc_html__( 'Component', 'elementor' );
25 }
26
27 public function get_keywords() {
28 return [ 'component' ];
29 }
30
31 public function get_icon() {
32 return 'eicon-components';
33 }
34
35 protected static function define_props_schema(): array {
36 return [
37 'component_instance' => Component_Instance_Prop_Type::make()->required(),
38 ];
39 }
40
41 protected function parse_editor_settings( array $data ): array {
42 $editor_data = parent::parse_editor_settings( $data );
43
44 if ( isset( $data['component_uid'] ) && is_string( $data['component_uid'] ) ) {
45 $editor_data['component_uid'] = sanitize_text_field( $data['component_uid'] );
46 }
47
48 return $editor_data;
49 }
50
51 protected function define_atomic_controls(): array {
52 return [];
53 }
54
55 protected function get_templates(): array {
56 return [
57 'elementor/elements/component' => __DIR__ . '/component.html.twig',
58 ];
59 }
60 }
61