PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.1
Elementor Website Builder – more than just a page builder v4.2.1
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 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | modules/atomic-widgets/elements/base/atomic-element-base.php +11 -47 4.3.0-beta3 → 4.2.1 View file →
@@ -2,9 +2,8 @@
2 2
3 3 namespace Elementor\Modules\AtomicWidgets\Elements\Base;
4 4
5 5 use Elementor\Element_Base;
6 -use Elementor\Modules\AtomicWidgets\ChildrenDependencies\Child_Dependency;
7 6 use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager;
8 7 use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Prop_Type;
9 8 use Elementor\Modules\AtomicWidgets\PropTypes\Concerns\Has_Meta;
10 9 use Elementor\Plugin;
@@ -17,20 +16,8 @@
17 16 abstract class Atomic_Element_Base extends Element_Base {
18 17 use Has_Atomic_Base;
19 18 use Has_Meta;
20 19
21 - /**
22 - * Maps atomic element type → the minor version when the "New" badge expires.
23 - * Format: 'element-type' => 'major.minor' (patch is ignored during comparison).
24 - *
25 - * @var array<string, string>
26 - */
27 - private const NEW_ATOMIC_ELEMENTS = [
28 - 'e-background-video' => '4.3',
29 - 'e-accordion' => '4.3',
30 - 'e-list' => '4.3',
31 - ];
32 -
33 20 protected $version = '0.0';
34 21 protected $styles = [];
35 22 protected $interactions = [];
36 23 protected $editor_settings = [];
@@ -105,16 +92,13 @@
105 92 $config['hide_on_search'] = false;
106 93 $config['controls'] = [];
107 94 $config['keywords'] = $this->get_keywords();
108 95 $config['default_children'] = $this->define_default_children();
109 - $config['children_dependencies'] = $this->get_children_dependencies_config();
110 96 $config['initial_attributes'] = $this->define_initial_attributes();
111 97 $config['include_in_widgets_config'] = true;
112 - $config['default_html_tag'] = static::get_computed_html_tag( [] );
113 - $config['html_tag_follows_link'] = static::html_tag_follows_link();
98 + $config['default_html_tag'] = $this->define_default_html_tag();
114 99 $config['meta'] = $this->get_meta();
115 100 $config['allowed_child_types'] = $this->define_allowed_child_types();
116 - $config['new_until_version'] = self::NEW_ATOMIC_ELEMENTS[ $this->get_name() ] ?? '';
117 101
118 102 return $config;
119 103 }
120 104
@@ -129,39 +113,12 @@
129 113 protected function define_default_children() {
130 114 return [];
131 115 }
132 116
133 - /**
134 - * Declare settings→children reconcile rules for this element.
135 - *
136 - * Each rule ties a `Dependency_Manager` condition on this element's
137 - * settings to the presence of a specific child element type. The generic
138 - * client-side reconciler (`@elementor/editor-elements/children-dependencies`)
139 - * attaches / detaches the child at the model layer as the condition flips,
140 - * without per-widget v1 hooks.
141 - *
142 - * @return Child_Dependency[]
143 - */
144 - protected function define_children_dependencies(): array {
145 - return [];
117 + protected function define_default_html_tag() {
118 + return 'div';
146 119 }
147 120
148 - private function get_children_dependencies_config(): array {
149 - $config = [];
150 -
151 - foreach ( $this->define_children_dependencies() as $dependency ) {
152 - if ( ! $dependency instanceof Child_Dependency ) {
153 - throw new \InvalidArgumentException(
154 - esc_html( static::class . '::define_children_dependencies() must return Child_Dependency instances.' )
155 - );
156 - }
157 -
158 - $config[] = $dependency->build();
159 - }
160 -
161 - return $config;
162 - }
163 -
164 121 protected function define_initial_attributes() {
165 122 return [];
166 123 }
167 124
@@ -203,9 +160,16 @@
203 160 *
204 161 * @return string
205 162 */
206 163 protected function get_html_tag(): string {
207 - return static::get_computed_html_tag( $this->get_atomic_settings() );
164 + $settings = $this->get_atomic_settings();
165 + $default_html_tag = $this->define_default_html_tag();
166 +
167 + if ( ! empty( $settings['link']['tag'] ) ) {
168 + return $settings['link']['tag'];
169 + }
170 +
171 + return $settings['tag'] ?? $default_html_tag;
208 172 }
209 173
210 174 /**
211 175 * Print safe HTML tag for the element based on the element settings.