PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.1
Elementor Website Builder – more than just a page builder v3.34.1
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 / documents / component.php

component.php in Elementor Website Builder – more than just a page builder 3.34.1, at modules/components/documents/component.php

68 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\Components\Documents;
3
4 use Elementor\Core\Base\Document;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly
8 }
9
10 class Component extends Document {
11 const TYPE = 'elementor_component';
12 const COMPONENT_UID_META_KEY = '_elementor_component_uid';
13 const OVERRIDABLE_PROPS_META_KEY = '_elementor_component_overridable_props';
14
15 public static function get_properties() {
16 $properties = parent::get_properties();
17
18 $properties['cpt'] = [ self::TYPE ];
19
20 return $properties;
21 }
22
23 public static function get_type() {
24 return self::TYPE;
25 }
26
27 public static function get_title() {
28 return esc_html__( 'Component', 'elementor' );
29 }
30
31 public static function get_plural_title() {
32 return esc_html__( 'Components', 'elementor' );
33 }
34
35 public static function get_labels(): array {
36 $plural_label = static::get_plural_title();
37 $singular_label = static::get_title();
38
39 $labels = [
40 'name' => $plural_label,
41 'singular_name' => $singular_label,
42 ];
43
44 return $labels;
45 }
46
47 public static function get_supported_features(): array {
48 return [
49 'title',
50 'author',
51 'thumbnail',
52 'custom-fields',
53 'revisions',
54 'elementor',
55 ];
56 }
57
58 public function get_component_uid() {
59 return $this->get_meta( self::COMPONENT_UID_META_KEY );
60 }
61
62 public function get_overridable_props(): Component_Overridable_Props {
63 $meta = $this->get_meta( self::OVERRIDABLE_PROPS_META_KEY );
64
65 return new Component_Overridable_Props( $meta );
66 }
67 }
68