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/flexbox/flexbox.php +9 -27 4.0.9 → 3.33.0-beta1 View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2 namespace Elementor\Modules\AtomicWidgets\Elements\Flexbox;
3 3
4 -use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
5 -use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
4 +use Elementor\Modules\AtomicWidgets\Elements\Atomic_Element_Base;
6 5 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
7 6 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
8 7 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
9 8 use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
@@ -10,12 +9,12 @@
10 9 use Elementor\Modules\AtomicWidgets\Controls\Section;
11 10 use Elementor\Modules\AtomicWidgets\Controls\Types\Html_Tag_Control;
12 11 use Elementor\Modules\AtomicWidgets\Controls\Types\Link_Control;
13 12 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
13 +use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
14 +use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
14 15 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
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 Flexbox 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-flexbox';
33 27 }
34 28
@@ -48,19 +42,10 @@
48 42 return 'eicon-flexbox';
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,23 +50,21 @@
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 - ->description( 'The HTML tag for the flexbox container. Could be div, header, section, article, aside, footer, or a (link).' )
78 63 ->set_dependencies( $tag_dependencies ),
79 64 'link' => Link_Prop_Type::make(),
80 - 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
65 + 'attributes' => Attributes_Prop_Type::make(),
81 66 ];
82 -
83 - return $schema;
84 67 }
85 68
86 69 protected function define_atomic_controls(): array {
87 70 return [
@@ -174,10 +157,9 @@
174 157 $attributes['id'] = esc_attr( $settings['_cssid'] );
175 158 }
176 159
177 160 if ( ! empty( $settings['link']['href'] ) ) {
178 - $link_attributes = $this->get_link_attributes( $settings['link'] );
179 - $attributes = array_merge( $attributes, $link_attributes );
161 + $attributes = array_merge( $attributes, $settings['link'] );
180 162 }
181 163
182 164 $this->add_render_attribute( '_wrapper', array_merge( $initial_attributes, $attributes ) );
183 165 }