PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.0-beta1
Elementor Website Builder – more than just a page builder v3.34.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 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 All 457 releases
← All changes | modules/atomic-widgets/elements/div-block/div-block.php +8 -48 4.3.4 → 3.34.0-beta1 View file →
@@ -1,10 +1,8 @@
1 1 <?php
2 2 namespace Elementor\Modules\AtomicWidgets\Elements\Div_Block;
3 3
4 -use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
5 -use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template;
6 -use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer;
4 +use Elementor\Modules\AtomicWidgets\Elements\Atomic_Element_Base;
7 5 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
8 6 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
9 7 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
10 8 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
@@ -15,9 +13,8 @@
15 13 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
16 14 use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
17 15 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
18 16 use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type;
19 -use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type;
20 17
21 18 if ( ! defined( 'ABSPATH' ) ) {
22 19 exit; // Exit if accessed directly.
23 20 }
@@ -22,23 +19,14 @@
22 19 exit; // Exit if accessed directly.
23 20 }
24 21
25 22 class Div_Block extends Atomic_Element_Base {
26 - use Has_Element_Template;
27 -
28 23 const BASE_STYLE_KEY = 'base';
29 24
30 - public function __construct( $data = [], $args = null ) {
31 - parent::__construct( $data, $args );
32 - $this->meta( 'is_container', true );
33 - }
34 -
35 25 public static function get_type() {
36 26 return 'e-div-block';
37 27 }
38 28
39 - public static $widget_description = 'A block container (div) for grouping and wrapping content, with default styles (see llm_guidance.default_styles).';
40 -
41 29 public static function get_element_type(): string {
42 30 return 'e-div-block';
43 31 }
44 32
@@ -46,9 +34,9 @@
46 34 return esc_html__( 'Div block', 'elementor' );
47 35 }
48 36
49 37 public function get_keywords() {
50 - return [ 'ato', 'atom', 'atoms', 'atomic', 'container', 'wrapper', 'section', 'row', 'column', 'div', 'box', 'layout' ];
38 + return [ 'ato', 'atom', 'atoms', 'atomic' ];
51 39 }
52 40
53 41 public function get_icon() {
54 42 return 'eicon-div-block';
@@ -53,24 +41,11 @@
53 41 public function get_icon() {
54 42 return 'eicon-div-block';
55 43 }
56 44
57 - public static function get_computed_html_tag( array $settings ): string {
58 - return Html_Tag_Computer::compute( $settings, 'div' );
59 - }
60 -
61 45 protected static function define_props_schema(): array {
62 - $tag_dependencies = Dependency_Manager::make( Dependency_Manager::RELATION_AND )
46 + $tag_dependencies = Dependency_Manager::make()
63 47 ->where( [
64 - 'operator' => 'ne',
65 - 'path' => [ 'link', 'destination' ],
66 - 'nestedPath' => [ 'group' ],
67 - 'value' => 'action',
68 - 'newValue' => [
69 - '$$type' => 'string',
70 - 'value' => 'button',
71 - ],
72 - ] )->where( [
73 48 'operator' => 'not_exist',
74 49 'path' => [ 'link', 'destination' ],
75 50 'newValue' => [
76 51 '$$type' => 'string',
@@ -75,20 +50,20 @@
75 50 'newValue' => [
76 51 '$$type' => 'string',
77 52 'value' => 'a',
78 53 ],
79 - ] )->get();
54 + ] )
55 + ->get();
80 56
81 57 return [
82 58 'classes' => Classes_Prop_Type::make()
83 59 ->default( [] ),
84 60 'tag' => String_Prop_Type::make()
85 - ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a', 'button', 'main', 'nav' ] )
61 + ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a' ] )
86 62 ->default( 'div' )
87 - ->description( 'The HTML tag for the div block container. One of: div, header, section, article, aside, footer, main, nav, a (link), or button. Do not use heading or paragraph tags.' )
88 63 ->set_dependencies( $tag_dependencies ),
89 64 'link' => Link_Prop_Type::make(),
90 - 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
65 + 'attributes' => Attributes_Prop_Type::make(),
91 66 ];
92 67 }
93 68
94 69 protected function define_atomic_controls(): array {
@@ -122,16 +97,8 @@
122 97 [
123 98 'value' => 'footer',
124 99 'label' => 'Footer',
125 100 ],
126 - [
127 - 'value' => 'main',
128 - 'label' => 'Main',
129 - ],
130 - [
131 - 'value' => 'nav',
132 - 'label' => 'Nav',
133 - ],
134 101 ])
135 102 ->set_fallback_labels( [
136 103 'a' => 'a (link)',
137 104 ] )
@@ -196,17 +163,10 @@
196 163 $attributes['id'] = esc_attr( $settings['_cssid'] );
197 164 }
198 165
199 166 if ( ! empty( $settings['link']['href'] ) ) {
200 - $link_attributes = $this->get_link_attributes( $settings['link'] );
201 - $attributes = array_merge( $attributes, $link_attributes );
167 + $attributes = array_merge( $attributes, $settings['link'] );
202 168 }
203 169
204 170 $this->add_render_attribute( '_wrapper', array_merge( $initial_attributes, $attributes ) );
205 - }
206 -
207 - protected function get_templates(): array {
208 - return [
209 - 'elementor/elements/div-block' => __DIR__ . '/div-block.html.twig',
210 - ];
211 171 }
212 172 }