PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.6
Elementor Website Builder – more than just a page builder v3.0.6
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 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | includes/widgets/accordion.php +83 -220 4.2.23.0.6 View file →
@@ -6,9 +6,8 @@
6 6 }
7 7
8 8 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
9 9 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
10 -
11 10 /**
12 11 * Elementor accordion widget.
13 12 *
14 13 * Elementor widget that displays a collapsible display of content in an
@@ -42,9 +41,9 @@
42 41 *
43 42 * @return string Widget title.
44 43 */
45 44 public function get_title() {
46 - return esc_html__( 'Accordion', 'elementor' );
45 + return __( 'Accordion', 'elementor' );
47 46 }
48 47
49 48 /**
50 49 * Get widget icon.
@@ -73,55 +72,21 @@
73 72 public function get_keywords() {
74 73 return [ 'accordion', 'tabs', 'toggle' ];
75 74 }
76 75
77 - protected function is_dynamic_content(): bool {
78 - return false;
79 - }
80 -
81 76 /**
82 - * Get style dependencies.
83 - *
84 - * Retrieve the list of style dependencies the widget requires.
85 - *
86 - * @since 3.24.0
87 - * @access public
88 - *
89 - * @return array Widget style dependencies.
90 - */
91 - public function get_style_depends(): array {
92 - return [ 'widget-accordion' ];
93 - }
94 -
95 - /**
96 - * Hide widget from panel.
97 - *
98 - * Hide the toggle widget from the panel if nested-accordion experiment is active.
99 - *
100 - * @since 3.15.0
101 - * @return bool
102 - */
103 - public function show_in_panel(): bool {
104 - return ! Plugin::$instance->experiments->is_feature_active( 'nested-elements', true );
105 - }
106 -
107 - public function has_widget_inner_wrapper(): bool {
108 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
109 - }
110 -
111 - /**
112 77 * Register accordion widget controls.
113 78 *
114 79 * Adds different input fields to allow the user to change and customize the widget settings.
115 80 *
116 - * @since 3.1.0
81 + * @since 1.0.0
117 82 * @access protected
118 83 */
119 - protected function register_controls() {
84 + protected function _register_controls() {
120 85 $this->start_controls_section(
121 86 'section_title',
122 87 [
123 - 'label' => esc_html__( 'Accordion', 'elementor' ),
88 + 'label' => __( 'Accordion', 'elementor' ),
124 89 ]
125 90 );
126 91
127 92 $repeater = new Repeater();
@@ -128,11 +93,11 @@
128 93
129 94 $repeater->add_control(
130 95 'tab_title',
131 96 [
132 - 'label' => esc_html__( 'Title', 'elementor' ),
97 + 'label' => __( 'Title & Description', 'elementor' ),
133 98 'type' => Controls_Manager::TEXT,
134 - 'default' => esc_html__( 'Accordion Title', 'elementor' ),
99 + 'default' => __( 'Accordion Title', 'elementor' ),
135 100 'dynamic' => [
136 101 'active' => true,
137 102 ],
138 103 'label_block' => true,
@@ -141,39 +106,29 @@
141 106
142 107 $repeater->add_control(
143 108 'tab_content',
144 109 [
145 - 'label' => esc_html__( 'Content', 'elementor' ),
110 + 'label' => __( 'Content', 'elementor' ),
146 111 'type' => Controls_Manager::WYSIWYG,
147 - 'default' => esc_html__( 'Accordion Content', 'elementor' ),
112 + 'default' => __( 'Accordion Content', 'elementor' ),
113 + 'show_label' => false,
148 114 ]
149 115 );
150 116
151 - if ( Plugin::$instance->widgets_manager->get_widget_types( 'nested-accordion' ) ) {
152 - $this->add_deprecation_message(
153 - '3.15.0',
154 - esc_html__(
155 - 'You are currently editing an Accordion Widget in its old version. Any new Accordion widget dragged into the canvas will be the new Accordion widget, with the improved Nested capabilities.',
156 - 'elementor'
157 - ),
158 - 'nested-accordion'
159 - );
160 - }
161 -
162 117 $this->add_control(
163 118 'tabs',
164 119 [
165 - 'label' => esc_html__( 'Accordion Items', 'elementor' ),
120 + 'label' => __( 'Accordion Items', 'elementor' ),
166 121 'type' => Controls_Manager::REPEATER,
167 122 'fields' => $repeater->get_controls(),
168 123 'default' => [
169 124 [
170 - 'tab_title' => esc_html__( 'Accordion #1', 'elementor' ),
171 - 'tab_content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ),
125 + 'tab_title' => __( 'Accordion #1', 'elementor' ),
126 + 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ),
172 127 ],
173 128 [
174 - 'tab_title' => esc_html__( 'Accordion #2', 'elementor' ),
175 - 'tab_content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ),
129 + 'tab_title' => __( 'Accordion #2', 'elementor' ),
130 + 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ),
176 131 ],
177 132 ],
178 133 'title_field' => '{{{ tab_title }}}',
179 134 ]
@@ -179,11 +134,20 @@
179 134 ]
180 135 );
181 136
182 137 $this->add_control(
138 + 'view',
139 + [
140 + 'label' => __( 'View', 'elementor' ),
141 + 'type' => Controls_Manager::HIDDEN,
142 + 'default' => 'traditional',
143 + ]
144 + );
145 +
146 + $this->add_control(
183 147 'selected_icon',
184 148 [
185 - 'label' => esc_html__( 'Icon', 'elementor' ),
149 + 'label' => __( 'Icon', 'elementor' ),
186 150 'type' => Controls_Manager::ICONS,
187 151 'separator' => 'before',
188 152 'fa4compatibility' => 'icon',
189 153 'default' => [
@@ -209,9 +173,9 @@
209 173
210 174 $this->add_control(
211 175 'selected_active_icon',
212 176 [
213 - 'label' => esc_html__( 'Active Icon', 'elementor' ),
177 + 'label' => __( 'Active Icon', 'elementor' ),
214 178 'type' => Controls_Manager::ICONS,
215 179 'fa4compatibility' => 'icon_active',
216 180 'default' => [
217 181 'value' => 'fas fa-minus',
@@ -239,9 +203,9 @@
239 203
240 204 $this->add_control(
241 205 'title_html_tag',
242 206 [
243 - 'label' => esc_html__( 'Title HTML Tag', 'elementor' ),
207 + 'label' => __( 'Title HTML Tag', 'elementor' ),
244 208 'type' => Controls_Manager::SELECT,
245 209 'options' => [
246 210 'h1' => 'H1',
247 211 'h2' => 'H2',
@@ -255,23 +219,14 @@
255 219 'separator' => 'before',
256 220 ]
257 221 );
258 222
259 - $this->add_control(
260 - 'faq_schema',
261 - [
262 - 'label' => esc_html__( 'FAQ Schema', 'elementor' ),
263 - 'type' => Controls_Manager::SWITCHER,
264 - 'separator' => 'before',
265 - ]
266 - );
267 -
268 223 $this->end_controls_section();
269 224
270 225 $this->start_controls_section(
271 226 'section_title_style',
272 227 [
273 - 'label' => esc_html__( 'Accordion', 'elementor' ),
228 + 'label' => __( 'Accordion', 'elementor' ),
274 229 'tab' => Controls_Manager::TAB_STYLE,
275 230 ]
276 231 );
277 232
@@ -277,23 +232,20 @@
277 232
278 233 $this->add_control(
279 234 'border_width',
280 235 [
281 - 'label' => esc_html__( 'Border Width', 'elementor' ),
236 + 'label' => __( 'Border Width', 'elementor' ),
282 237 'type' => Controls_Manager::SLIDER,
283 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
284 238 'range' => [
285 239 'px' => [
286 - 'max' => 20,
240 + 'min' => 0,
241 + 'max' => 10,
287 242 ],
288 - 'em' => [
289 - 'max' => 2,
290 - ],
291 243 ],
292 244 'selectors' => [
293 - '{{WRAPPER}} .elementor-accordion-item' => 'border-width: {{SIZE}}{{UNIT}};',
294 - '{{WRAPPER}} .elementor-accordion-item .elementor-tab-content' => 'border-width: {{SIZE}}{{UNIT}};',
295 - '{{WRAPPER}} .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-width: {{SIZE}}{{UNIT}};',
245 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-item' => 'border-width: {{SIZE}}{{UNIT}};',
246 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-content' => 'border-width: {{SIZE}}{{UNIT}};',
247 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-width: {{SIZE}}{{UNIT}};',
296 248 ],
297 249 ]
298 250 );
299 251
@@ -299,14 +251,14 @@
299 251
300 252 $this->add_control(
301 253 'border_color',
302 254 [
303 - 'label' => esc_html__( 'Border Color', 'elementor' ),
255 + 'label' => __( 'Border Color', 'elementor' ),
304 256 'type' => Controls_Manager::COLOR,
305 257 'selectors' => [
306 - '{{WRAPPER}} .elementor-accordion-item' => 'border-color: {{VALUE}};',
307 - '{{WRAPPER}} .elementor-accordion-item .elementor-tab-content' => 'border-block-start-color: {{VALUE}};',
308 - '{{WRAPPER}} .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-block-end-color: {{VALUE}};',
258 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-item' => 'border-color: {{VALUE}};',
259 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-content' => 'border-top-color: {{VALUE}};',
260 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-bottom-color: {{VALUE}};',
309 261 ],
310 262 ]
311 263 );
312 264
@@ -314,9 +266,9 @@
314 266
315 267 $this->start_controls_section(
316 268 'section_toggle_style_title',
317 269 [
318 - 'label' => esc_html__( 'Title', 'elementor' ),
270 + 'label' => __( 'Title', 'elementor' ),
319 271 'tab' => Controls_Manager::TAB_STYLE,
320 272 ]
321 273 );
322 274
@@ -322,12 +274,12 @@
322 274
323 275 $this->add_control(
324 276 'title_background',
325 277 [
326 - 'label' => esc_html__( 'Background', 'elementor' ),
278 + 'label' => __( 'Background', 'elementor' ),
327 279 'type' => Controls_Manager::COLOR,
328 280 'selectors' => [
329 - '{{WRAPPER}} .elementor-tab-title' => 'background-color: {{VALUE}};',
281 + '{{WRAPPER}} .elementor-accordion .elementor-tab-title' => 'background-color: {{VALUE}};',
330 282 ],
331 283 ]
332 284 );
333 285
@@ -333,13 +285,12 @@
333 285
334 286 $this->add_control(
335 287 'title_color',
336 288 [
337 - 'label' => esc_html__( 'Color', 'elementor' ),
289 + 'label' => __( 'Color', 'elementor' ),
338 290 'type' => Controls_Manager::COLOR,
339 291 'selectors' => [
340 292 '{{WRAPPER}} .elementor-accordion-icon, {{WRAPPER}} .elementor-accordion-title' => 'color: {{VALUE}};',
341 - '{{WRAPPER}} .elementor-accordion-icon svg' => 'fill: {{VALUE}};',
342 293 ],
343 294 'global' => [
344 295 'default' => Global_Colors::COLOR_PRIMARY,
345 296 ],
@@ -348,13 +299,12 @@
348 299
349 300 $this->add_control(
350 301 'tab_active_color',
351 302 [
352 - 'label' => esc_html__( 'Active Color', 'elementor' ),
303 + 'label' => __( 'Active Color', 'elementor' ),
353 304 'type' => Controls_Manager::COLOR,
354 305 'selectors' => [
355 306 '{{WRAPPER}} .elementor-active .elementor-accordion-icon, {{WRAPPER}} .elementor-active .elementor-accordion-title' => 'color: {{VALUE}};',
356 - '{{WRAPPER}} .elementor-active .elementor-accordion-icon svg' => 'fill: {{VALUE}};',
357 307 ],
358 308 'global' => [
359 309 'default' => Global_Colors::COLOR_ACCENT,
360 310 ],
@@ -364,9 +314,9 @@
364 314 $this->add_group_control(
365 315 Group_Control_Typography::get_type(),
366 316 [
367 317 'name' => 'title_typography',
368 - 'selector' => '{{WRAPPER}} .elementor-accordion-title',
318 + 'selector' => '{{WRAPPER}} .elementor-accordion .elementor-accordion-title',
369 319 'global' => [
370 320 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
371 321 ],
372 322 ]
@@ -371,32 +321,16 @@
371 321 ],
372 322 ]
373 323 );
374 324
375 - $this->add_group_control(
376 - Group_Control_Text_Stroke::get_type(),
377 - [
378 - 'name' => 'text_stroke',
379 - 'selector' => '{{WRAPPER}} .elementor-accordion-title',
380 - ]
381 - );
382 -
383 - $this->add_group_control(
384 - Group_Control_Text_Shadow::get_type(),
385 - [
386 - 'name' => 'title_shadow',
387 - 'selector' => '{{WRAPPER}} .elementor-accordion-title',
388 - ]
389 - );
390 -
391 325 $this->add_responsive_control(
392 326 'title_padding',
393 327 [
394 - 'label' => esc_html__( 'Padding', 'elementor' ),
328 + 'label' => __( 'Padding', 'elementor' ),
395 329 'type' => Controls_Manager::DIMENSIONS,
396 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
330 + 'size_units' => [ 'px', 'em', '%' ],
397 331 'selectors' => [
398 - '{{WRAPPER}} .elementor-tab-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
332 + '{{WRAPPER}} .elementor-accordion .elementor-tab-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
399 333 ],
400 334 ]
401 335 );
402 336
@@ -404,9 +338,9 @@
404 338
405 339 $this->start_controls_section(
406 340 'section_toggle_style_icon',
407 341 [
408 - 'label' => esc_html__( 'Icon', 'elementor' ),
342 + 'label' => __( 'Icon', 'elementor' ),
409 343 'tab' => Controls_Manager::TAB_STYLE,
410 344 'condition' => [
411 345 'selected_icon[value]!' => '',
412 346 ],
@@ -415,17 +349,17 @@
415 349
416 350 $this->add_control(
417 351 'icon_align',
418 352 [
419 - 'label' => esc_html__( 'Alignment', 'elementor' ),
353 + 'label' => __( 'Alignment', 'elementor' ),
420 354 'type' => Controls_Manager::CHOOSE,
421 355 'options' => [
422 356 'left' => [
423 - 'title' => esc_html__( 'Start', 'elementor' ),
357 + 'title' => __( 'Start', 'elementor' ),
424 358 'icon' => 'eicon-h-align-left',
425 359 ],
426 360 'right' => [
427 - 'title' => esc_html__( 'End', 'elementor' ),
361 + 'title' => __( 'End', 'elementor' ),
428 362 'icon' => 'eicon-h-align-right',
429 363 ],
430 364 ],
431 365 'default' => is_rtl() ? 'right' : 'left',
@@ -435,13 +369,13 @@
435 369
436 370 $this->add_control(
437 371 'icon_color',
438 372 [
439 - 'label' => esc_html__( 'Color', 'elementor' ),
373 + 'label' => __( 'Color', 'elementor' ),
440 374 'type' => Controls_Manager::COLOR,
441 375 'selectors' => [
442 - '{{WRAPPER}} .elementor-tab-title .elementor-accordion-icon i:before' => 'color: {{VALUE}};',
443 - '{{WRAPPER}} .elementor-tab-title .elementor-accordion-icon svg' => 'fill: {{VALUE}};',
376 + '{{WRAPPER}} .elementor-accordion .elementor-tab-title .elementor-accordion-icon i:before' => 'color: {{VALUE}};',
377 + '{{WRAPPER}} .elementor-accordion .elementor-tab-title .elementor-accordion-icon svg' => 'fill: {{VALUE}};',
444 378 ],
445 379 ]
446 380 );
447 381
@@ -447,13 +381,13 @@
447 381
448 382 $this->add_control(
449 383 'icon_active_color',
450 384 [
451 - 'label' => esc_html__( 'Active Color', 'elementor' ),
385 + 'label' => __( 'Active Color', 'elementor' ),
452 386 'type' => Controls_Manager::COLOR,
453 387 'selectors' => [
454 - '{{WRAPPER}} .elementor-tab-title.elementor-active .elementor-accordion-icon i:before' => 'color: {{VALUE}};',
455 - '{{WRAPPER}} .elementor-tab-title.elementor-active .elementor-accordion-icon svg' => 'fill: {{VALUE}};',
388 + '{{WRAPPER}} .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon i:before' => 'color: {{VALUE}};',
389 + '{{WRAPPER}} .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon svg' => 'fill: {{VALUE}};',
456 390 ],
457 391 ]
458 392 );
459 393
@@ -459,24 +393,19 @@
459 393
460 394 $this->add_responsive_control(
461 395 'icon_space',
462 396 [
463 - 'label' => esc_html__( 'Spacing', 'elementor' ),
397 + 'label' => __( 'Spacing', 'elementor' ),
464 398 'type' => Controls_Manager::SLIDER,
465 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
466 399 'range' => [
467 400 'px' => [
401 + 'min' => 0,
468 402 'max' => 100,
469 403 ],
470 - 'em' => [
471 - 'max' => 1,
472 - ],
473 - 'rem' => [
474 - 'max' => 1,
475 - ],
476 404 ],
477 405 'selectors' => [
478 - '{{WRAPPER}} .elementor-accordion-icon' => 'margin-inline-end: {{SIZE}}{{UNIT}};',
406 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-icon.elementor-accordion-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
407 + '{{WRAPPER}} .elementor-accordion .elementor-accordion-icon.elementor-accordion-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
479 408 ],
480 409 ]
481 410 );
482 411
@@ -484,9 +413,9 @@
484 413
485 414 $this->start_controls_section(
486 415 'section_toggle_style_content',
487 416 [
488 - 'label' => esc_html__( 'Content', 'elementor' ),
417 + 'label' => __( 'Content', 'elementor' ),
489 418 'tab' => Controls_Manager::TAB_STYLE,
490 419 ]
491 420 );
492 421
@@ -492,12 +421,12 @@
492 421
493 422 $this->add_control(
494 423 'content_background_color',
495 424 [
496 - 'label' => esc_html__( 'Background', 'elementor' ),
425 + 'label' => __( 'Background', 'elementor' ),
497 426 'type' => Controls_Manager::COLOR,
498 427 'selectors' => [
499 - '{{WRAPPER}} .elementor-tab-content' => 'background-color: {{VALUE}};',
428 + '{{WRAPPER}} .elementor-accordion .elementor-tab-content' => 'background-color: {{VALUE}};',
500 429 ],
501 430 ]
502 431 );
503 432
@@ -503,12 +432,12 @@
503 432
504 433 $this->add_control(
505 434 'content_color',
506 435 [
507 - 'label' => esc_html__( 'Color', 'elementor' ),
436 + 'label' => __( 'Color', 'elementor' ),
508 437 'type' => Controls_Manager::COLOR,
509 438 'selectors' => [
510 - '{{WRAPPER}} .elementor-tab-content' => 'color: {{VALUE}};',
439 + '{{WRAPPER}} .elementor-accordion .elementor-tab-content' => 'color: {{VALUE}};',
511 440 ],
512 441 'global' => [
513 442 'default' => Global_Colors::COLOR_TEXT,
514 443 ],
@@ -518,9 +447,9 @@
518 447 $this->add_group_control(
519 448 Group_Control_Typography::get_type(),
520 449 [
521 450 'name' => 'content_typography',
522 - 'selector' => '{{WRAPPER}} .elementor-tab-content',
451 + 'selector' => '{{WRAPPER}} .elementor-accordion .elementor-tab-content',
523 452 'global' => [
524 453 'default' => Global_Typography::TYPOGRAPHY_TEXT,
525 454 ],
526 455 ]
@@ -525,24 +454,16 @@
525 454 ],
526 455 ]
527 456 );
528 457
529 - $this->add_group_control(
530 - Group_Control_Text_Shadow::get_type(),
531 - [
532 - 'name' => 'content_shadow',
533 - 'selector' => '{{WRAPPER}} .elementor-tab-content',
534 - ]
535 - );
536 -
537 458 $this->add_responsive_control(
538 459 'content_padding',
539 460 [
540 - 'label' => esc_html__( 'Padding', 'elementor' ),
461 + 'label' => __( 'Padding', 'elementor' ),
541 462 'type' => Controls_Manager::DIMENSIONS,
542 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
463 + 'size_units' => [ 'px', 'em', '%' ],
543 464 'selectors' => [
544 - '{{WRAPPER}} .elementor-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
465 + '{{WRAPPER}} .elementor-accordion .elementor-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
545 466 ],
546 467 ]
547 468 );
548 469
@@ -573,9 +494,9 @@
573 494 $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed();
574 495 $has_icon = ( ! $is_new || ! empty( $settings['selected_icon']['value'] ) );
575 496 $id_int = substr( $this->get_id_int(), 0, 3 );
576 497 ?>
577 - <div class="elementor-accordion">
498 + <div class="elementor-accordion" role="tablist">
578 499 <?php
579 500 foreach ( $settings['tabs'] as $index => $item ) :
580 501 $tab_count = $index + 1;
581 502
@@ -586,11 +507,10 @@
586 507 $this->add_render_attribute( $tab_title_setting_key, [
587 508 'id' => 'elementor-tab-title-' . $id_int . $tab_count,
588 509 'class' => [ 'elementor-tab-title' ],
589 510 'data-tab' => $tab_count,
590 - 'role' => 'button',
511 + 'role' => 'tab',
591 512 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count,
592 - 'aria-expanded' => 'false',
593 513 ] );
594 514
595 515 $this->add_render_attribute( $tab_content_setting_key, [
596 516 'id' => 'elementor-tab-content-' . $id_int . $tab_count,
@@ -595,9 +515,9 @@
595 515 $this->add_render_attribute( $tab_content_setting_key, [
596 516 'id' => 'elementor-tab-content-' . $id_int . $tab_count,
597 517 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ],
598 518 'data-tab' => $tab_count,
599 - 'role' => 'region',
519 + 'role' => 'tabpanel',
600 520 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count,
601 521 ] );
602 522
603 523 $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' );
@@ -602,9 +522,9 @@
602 522
603 523 $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' );
604 524 ?>
605 525 <div class="elementor-accordion-item">
606 - <<?php Utils::print_validated_html_tag( $settings['title_html_tag'] ); ?> <?php $this->print_render_attribute_string( $tab_title_setting_key ); ?>>
526 + <<?php echo $settings['title_html_tag']; ?> <?php echo $this->get_render_attribute_string( $tab_title_setting_key ); ?>>
607 527 <?php if ( $has_icon ) : ?>
608 528 <span class="elementor-accordion-icon elementor-accordion-icon-<?php echo esc_attr( $settings['icon_align'] ); ?>" aria-hidden="true">
609 529 <?php
610 530 if ( $is_new || $migrated ) { ?>
@@ -615,38 +535,13 @@
615 535 <i class="elementor-accordion-icon-opened <?php echo esc_attr( $settings['icon_active'] ); ?>"></i>
616 536 <?php } ?>
617 537 </span>
618 538 <?php endif; ?>
619 - <a class="elementor-accordion-title" tabindex="0"><?php
620 - $this->print_unescaped_setting( 'tab_title', 'tabs', $index );
621 - ?></a>
622 - </<?php Utils::print_validated_html_tag( $settings['title_html_tag'] ); ?>>
623 - <div <?php $this->print_render_attribute_string( $tab_content_setting_key ); ?>><?php
624 - $this->print_text_editor( $item['tab_content'] );
625 - ?></div>
539 + <a class="elementor-accordion-title" href=""><?php echo $item['tab_title']; ?></a>
540 + </<?php echo $settings['title_html_tag']; ?>>
541 + <div <?php echo $this->get_render_attribute_string( $tab_content_setting_key ); ?>><?php echo $this->parse_text_editor( $item['tab_content'] ); ?></div>
626 542 </div>
627 543 <?php endforeach; ?>
628 - <?php
629 - if ( isset( $settings['faq_schema'] ) && 'yes' === $settings['faq_schema'] ) {
630 - $json = [
631 - '@context' => 'https://schema.org',
632 - '@type' => 'FAQPage',
633 - 'mainEntity' => [],
634 - ];
635 -
636 - foreach ( $settings['tabs'] as $index => $item ) {
637 - $json['mainEntity'][] = [
638 - '@type' => 'Question',
639 - 'name' => wp_strip_all_tags( $item['tab_title'] ),
640 - 'acceptedAnswer' => [
641 - '@type' => 'Answer',
642 - 'text' => $this->parse_text_editor( $item['tab_content'] ),
643 - ],
644 - ];
645 - }
646 - ?>
647 - <script type="application/ld+json"><?php echo wp_json_encode( $json ); ?></script>
648 - <?php } ?>
649 544 </div>
650 545 <?php
651 546 }
652 547
@@ -657,40 +552,11 @@
657 552 *
658 553 * @since 2.9.0
659 554 * @access protected
660 555 */
661 - public function render_markdown(): string {
662 - $settings = $this->get_settings_for_display();
663 -
664 - if ( empty( $settings['tabs'] ) ) {
665 - return '';
666 - }
667 -
668 - $sections = [];
669 -
670 - foreach ( $settings['tabs'] as $item ) {
671 - $title = Utils::html_to_plain_text( $item['tab_title'] ?? '' );
672 - $content = \Elementor\Modules\MarkdownRender\Html_To_Markdown::convert( $item['tab_content'] ?? '' );
673 -
674 - if ( empty( $title ) && empty( $content ) ) {
675 - continue;
676 - }
677 -
678 - $section = '### ' . $title;
679 -
680 - if ( ! empty( $content ) ) {
681 - $section .= "\n\n" . $content;
682 - }
683 -
684 - $sections[] = $section;
685 - }
686 -
687 - return implode( "\n\n", $sections );
688 - }
689 -
690 556 protected function content_template() {
691 557 ?>
692 - <div class="elementor-accordion">
558 + <div class="elementor-accordion" role="tablist">
693 559 <#
694 560 if ( settings.tabs ) {
695 561 var tabindex = view.getIDInt().toString().substr( 0, 3 ),
696 562 iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, {}, 'i' , 'object' ),
@@ -706,11 +572,10 @@
706 572 'id': 'elementor-tab-title-' + tabindex + tabCount,
707 573 'class': [ 'elementor-tab-title' ],
708 574 'tabindex': tabindex + tabCount,
709 575 'data-tab': tabCount,
710 - 'role': 'button',
711 - 'aria-controls': 'elementor-tab-content-' + tabindex + tabCount,
712 - 'aria-expanded': 'false',
576 + 'role': 'tab',
577 + 'aria-controls': 'elementor-tab-content-' + tabindex + tabCount
713 578 } );
714 579
715 580 view.addRenderAttribute( tabContentKey, {
716 581 'id': 'elementor-tab-content-' + tabindex + tabCount,
@@ -715,18 +580,16 @@
715 580 view.addRenderAttribute( tabContentKey, {
716 581 'id': 'elementor-tab-content-' + tabindex + tabCount,
717 582 'class': [ 'elementor-tab-content', 'elementor-clearfix' ],
718 583 'data-tab': tabCount,
719 - 'role': 'region',
584 + 'role': 'tabpanel',
720 585 'aria-labelledby': 'elementor-tab-title-' + tabindex + tabCount
721 586 } );
722 587
723 588 view.addInlineEditingAttributes( tabContentKey, 'advanced' );
724 -
725 - var titleHTMLTag = elementor.helpers.validateHTMLTag( settings.title_html_tag );
726 589 #>
727 590 <div class="elementor-accordion-item">
728 - <{{{ titleHTMLTag }}} {{{ view.getRenderAttributeString( tabTitleKey ) }}}>
591 + <{{{ settings.title_html_tag }}} {{{ view.getRenderAttributeString( tabTitleKey ) }}}>
729 592 <# if ( settings.icon || settings.selected_icon ) { #>
730 593 <span class="elementor-accordion-icon elementor-accordion-icon-{{ settings.icon_align }}" aria-hidden="true">
731 594 <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #>
732 595 <span class="elementor-accordion-icon-closed">{{{ iconHTML.value }}}</span>
@@ -736,10 +599,10 @@
736 599 <i class="elementor-accordion-icon-opened {{ settings.icon_active }}"></i>
737 600 <# } #>
738 601 </span>
739 602 <# } #>
740 - <a class="elementor-accordion-title" tabindex="0">{{{ item.tab_title }}}</a>
741 - </{{{ titleHTMLTag }}}>
603 + <a class="elementor-accordion-title" href="">{{{ item.tab_title }}}</a>
604 + </{{{ settings.title_html_tag }}}>
742 605 <div {{{ view.getRenderAttributeString( tabContentKey ) }}}>{{{ item.tab_content }}}</div>
743 606 </div>
744 607 <#
745 608 } );