PluginProbe
Elementor Website Builder – more than just a page builder / 3.31.2
Elementor Website Builder – more than just a page builder v3.31.2
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-divider / atomic-divider.php

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

97 lines 2.4 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_Divider;
4
5 use Elementor\Modules\AtomicWidgets\Elements\Atomic_Widget_Base;
6 use Elementor\Modules\AtomicWidgets\Elements\Has_Template;
7 use Elementor\Modules\AtomicWidgets\PropTypes\Background_Prop_Type;
8 use Elementor\Modules\AtomicWidgets\PropTypes\Key_Value_Array_Prop_Type;
9 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
10 use Elementor\Modules\AtomicWidgets\PropTypes\Color_Prop_Type;
11 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
12 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
13 use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 class Atomic_Divider extends Atomic_Widget_Base {
20
21 use Has_Template;
22
23 protected function get_css_id_control_meta(): array {
24 return [
25 'layout' => 'two-columns',
26 'topDivider' => false,
27 ];
28 }
29
30 public static function get_element_type(): string {
31 return 'e-divider';
32 }
33
34 public function get_title() {
35 return esc_html__( 'Divider', 'elementor' );
36 }
37
38 public function get_keywords() {
39 return [ 'ato', 'atom', 'atoms', 'atomic', 'divider', 'hr', 'line', 'border', 'separator' ];
40 }
41
42 public function get_icon() {
43 return 'eicon-e-divider';
44 }
45
46 protected static function define_props_schema(): array {
47 return [
48 'classes' => Classes_Prop_Type::make()
49 ->default( [] ),
50
51 'attributes' => Key_Value_Array_Prop_Type::make(),
52 ];
53 }
54
55 protected function define_atomic_controls(): array {
56 return [];
57 }
58
59 protected function get_settings_controls(): array {
60 return [];
61 }
62
63 protected function define_base_styles(): array {
64 $border_width_value = Size_Prop_Type::generate([
65 'size' => 0,
66 'unit' => 'px',
67 ]);
68
69 $height_value = Size_Prop_Type::generate([
70 'size' => 1,
71 'unit' => 'px',
72 ]);
73
74 $background_value = Background_Prop_Type::generate([
75 'color' => Color_Prop_Type::generate( '#000' ),
76 ]);
77
78 return [
79 'base' => Style_Definition::make()
80 ->add_variant(
81 Style_Variant::make()
82 ->add_prop( 'border-width', $border_width_value )
83 ->add_prop( 'border-color', 'transparent' )
84 ->add_prop( 'border-style', 'none' )
85 ->add_prop( 'background', $background_value )
86 ->add_prop( 'height', $height_value )
87 ),
88 ];
89 }
90
91 protected function get_templates(): array {
92 return [
93 'elementor/elements/atomic-divider' => __DIR__ . '/atomic-divider.html.twig',
94 ];
95 }
96 }
97