PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.0-dev3
Elementor Website Builder – more than just a page builder v3.20.0-dev3
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 4.0.8 All 454 releases
← All changes | includes/widgets/menu-anchor.php +4 -49 4.3.0-beta1 → 3.20.0-dev3 View file →
@@ -70,31 +70,9 @@
70 70 public function get_keywords() {
71 71 return [ 'menu', 'anchor', 'link' ];
72 72 }
73 73
74 - protected function is_dynamic_content(): bool {
75 - return false;
76 - }
77 -
78 74 /**
79 - * Get style dependencies.
80 - *
81 - * Retrieve the list of style dependencies the widget requires.
82 - *
83 - * @since 3.24.0
84 - * @access public
85 - *
86 - * @return array Widget style dependencies.
87 - */
88 - public function get_style_depends(): array {
89 - return [ 'widget-menu-anchor' ];
90 - }
91 -
92 - public function has_widget_inner_wrapper(): bool {
93 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
94 - }
95 -
96 - /**
97 75 * Register menu anchor widget controls.
98 76 *
99 77 * Adds different input fields to allow the user to change and customize the widget settings.
100 78 *
@@ -152,19 +130,13 @@
152 130 */
153 131 protected function render() {
154 132 $anchor = $this->get_settings_for_display( 'anchor' );
155 133
156 - if ( empty( $anchor ) ) {
157 - return;
134 + if ( ! empty( $anchor ) ) {
135 + $this->add_render_attribute( 'inner', 'id', sanitize_html_class( $anchor ) );
158 136 }
159 137
160 - $this->add_render_attribute(
161 - 'inner',
162 - [
163 - 'class' => 'elementor-menu-anchor',
164 - 'id' => sanitize_html_class( $anchor ),
165 - ]
166 - );
138 + $this->add_render_attribute( 'inner', 'class', 'elementor-menu-anchor' );
167 139 ?>
168 140 <div <?php $this->print_render_attribute_string( 'inner' ); ?>></div>
169 141 <?php
170 142 }
@@ -178,27 +150,10 @@
178 150 * @access protected
179 151 */
180 152 protected function content_template() {
181 153 ?>
182 - <#
183 - if ( '' === settings.anchor ) {
184 - return;
185 - }
186 -
187 - view.addRenderAttribute(
188 - 'inner',
189 - {
190 - 'class': 'elementor-menu-anchor',
191 - 'id': settings.anchor,
192 - }
193 - );
194 - #>
195 - <div {{{ view.getRenderAttributeString( 'inner' ) }}}></div>
154 + <div class="elementor-menu-anchor"{{{ settings.anchor ? ' id="' + settings.anchor + '"' : '' }}}></div>
196 155 <?php
197 - }
198 -
199 - public function render_markdown(): string {
200 - return '';
201 156 }
202 157
203 158 protected function on_save( array $settings ) {
204 159 $settings['anchor'] = sanitize_html_class( $settings['anchor'] );