PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0-beta3
Elementor Website Builder – more than just a page builder v4.3.0-beta3
4.3.0-beta3 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 All 452 releases
elementor / modules / atomic-widgets / elements / atomic-collection-loop / collection-loop-promotion.php

collection-loop-promotion.php in Elementor Website Builder – more than just a page builder 4.3.0-beta3, at modules/atomic-widgets/elements/atomic-collection-loop/collection-loop-promotion.php

89 lines 2.2 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\Atomic_Collection_Loop;
4
5 use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
6 use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template;
7 use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer;
8 use Elementor\Modules\AtomicWidgets\Elements\Promotions\Preserves_Children_Subtree;
9 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
10 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
11 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
12 use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 class Collection_Loop_Promotion extends Atomic_Element_Base {
19 use Has_Element_Template;
20 use Preserves_Children_Subtree;
21
22 const BASE_STYLE_KEY = 'base';
23
24 public function __construct( $data = [], $args = null ) {
25 parent::__construct( $data, $args );
26 $this->meta( 'is_container', true );
27 $this->meta( 'is_compound', true );
28 $this->meta( 'is_pro_promotion', true );
29 }
30
31 public static function get_type() {
32 return 'e-collection-loop';
33 }
34
35 public static function get_element_type(): string {
36 return self::get_type();
37 }
38
39 public function get_title() {
40 return esc_html__( 'Loop', 'elementor' );
41 }
42
43 public function get_icon() {
44 return 'eicon-loop-widget';
45 }
46
47 public static function get_computed_html_tag( array $settings ): string {
48 return Html_Tag_Computer::compute( $settings, 'div' );
49 }
50
51 protected static function define_props_schema(): array {
52 return [
53 'classes' => Classes_Prop_Type::make()
54 ->default( [] ),
55 ];
56 }
57
58 protected function define_atomic_controls(): array {
59 return [];
60 }
61
62 protected function define_base_styles(): array {
63 return [
64 static::BASE_STYLE_KEY => Style_Definition::make()
65 ->add_variant(
66 Style_Variant::make()
67 ->add_prop( 'display', String_Prop_Type::generate( 'block' ) )
68 ),
69 ];
70 }
71
72 protected function should_show_in_panel() {
73 return false;
74 }
75
76 protected function should_print_empty() {
77 return false;
78 }
79
80 public function print_content() {
81 }
82
83 protected function get_templates(): array {
84 return [
85 'elementor/elements/collection-loop-promotion' => __DIR__ . '/collection-loop-promotion.html.twig',
86 ];
87 }
88 }
89