PluginProbe
Elementor Website Builder – more than just a page builder / 3.33.0-beta1
Elementor Website Builder – more than just a page builder v3.33.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 +7 -22 4.0.9 → 3.33.0-beta1 View file →
@@ -1,8 +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;
4 +use Elementor\Modules\AtomicWidgets\Elements\Atomic_Element_Base;
5 5 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
6 6 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
7 7 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
8 8 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
@@ -13,9 +13,8 @@
13 13 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
14 14 use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
15 15 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
16 16 use Elementor\Modules\AtomicWidgets\PropTypes\Link_Prop_Type;
17 -use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type;
18 17
19 18 if ( ! defined( 'ABSPATH' ) ) {
20 19 exit; // Exit if accessed directly.
21 20 }
@@ -22,13 +21,8 @@
22 21
23 22 class Div_Block extends Atomic_Element_Base {
24 23 const BASE_STYLE_KEY = 'base';
25 24
26 - public function __construct( $data = [], $args = null ) {
27 - parent::__construct( $data, $args );
28 - $this->meta( 'is_container', true );
29 - }
30 -
31 25 public static function get_type() {
32 26 return 'e-div-block';
33 27 }
34 28
@@ -48,19 +42,10 @@
48 42 return 'eicon-div-block';
49 43 }
50 44
51 45 protected static function define_props_schema(): array {
52 - $tag_dependencies = Dependency_Manager::make( Dependency_Manager::RELATION_AND )
46 + $tag_dependencies = Dependency_Manager::make()
53 47 ->where( [
54 - 'operator' => 'ne',
55 - 'path' => [ 'link', 'destination' ],
56 - 'nestedPath' => [ 'group' ],
57 - 'value' => 'action',
58 - 'newValue' => [
59 - '$$type' => 'string',
60 - 'value' => 'button',
61 - ],
62 - ] )->where( [
63 48 'operator' => 'not_exist',
64 49 'path' => [ 'link', 'destination' ],
65 50 'newValue' => [
66 51 '$$type' => 'string',
@@ -65,19 +50,20 @@
65 50 'newValue' => [
66 51 '$$type' => 'string',
67 52 'value' => 'a',
68 53 ],
69 - ] )->get();
54 + ] )
55 + ->get();
70 56
71 57 return [
72 58 'classes' => Classes_Prop_Type::make()
73 59 ->default( [] ),
74 60 'tag' => String_Prop_Type::make()
75 - ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a', 'button' ] )
61 + ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a' ] )
76 62 ->default( 'div' )
77 63 ->set_dependencies( $tag_dependencies ),
78 64 'link' => Link_Prop_Type::make(),
79 - 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
65 + 'attributes' => Attributes_Prop_Type::make(),
80 66 ];
81 67 }
82 68
83 69 protected function define_atomic_controls(): array {
@@ -177,10 +163,9 @@
177 163 $attributes['id'] = esc_attr( $settings['_cssid'] );
178 164 }
179 165
180 166 if ( ! empty( $settings['link']['href'] ) ) {
181 - $link_attributes = $this->get_link_attributes( $settings['link'] );
182 - $attributes = array_merge( $attributes, $link_attributes );
167 + $attributes = array_merge( $attributes, $settings['link'] );
183 168 }
184 169
185 170 $this->add_render_attribute( '_wrapper', array_merge( $initial_attributes, $attributes ) );
186 171 }