| @@ -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,43 +72,9 @@ | ||
| 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 | * |
| @@ -119,9 +84,9 @@ | ||
| 119 | 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', |
| @@ -258,9 +222,9 @@ | ||
| 258 | 222 | |
| 259 | 223 | $this->add_control( |
| 260 | 224 | 'faq_schema', |
| 261 | 225 | [ |
| 262 | - 'label' => esc_html__( 'FAQ Schema', 'elementor' ), | |
| 226 | + 'label' => __( 'FAQ Schema', 'elementor' ), | |
| 263 | 227 | 'type' => Controls_Manager::SWITCHER, |
| 264 | 228 | 'separator' => 'before', |
| 265 | 229 | ] |
| 266 | 230 | ); |
| @@ -269,9 +233,9 @@ | ||
| 269 | 233 | |
| 270 | 234 | $this->start_controls_section( |
| 271 | 235 | 'section_title_style', |
| 272 | 236 | [ |
| 273 | - 'label' => esc_html__( 'Accordion', 'elementor' ), | |
| 237 | + 'label' => __( 'Accordion', 'elementor' ), | |
| 274 | 238 | 'tab' => Controls_Manager::TAB_STYLE, |
| 275 | 239 | ] |
| 276 | 240 | ); |
| 277 | 241 | |
| @@ -277,18 +241,15 @@ | ||
| 277 | 241 | |
| 278 | 242 | $this->add_control( |
| 279 | 243 | 'border_width', |
| 280 | 244 | [ |
| 281 | - 'label' => esc_html__( 'Border Width', 'elementor' ), | |
| 245 | + 'label' => __( 'Border Width', 'elementor' ), | |
| 282 | 246 | 'type' => Controls_Manager::SLIDER, |
| 283 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 284 | 247 | 'range' => [ |
| 285 | 248 | 'px' => [ |
| 286 | - 'max' => 20, | |
| 249 | + 'min' => 0, | |
| 250 | + 'max' => 10, | |
| 287 | 251 | ], |
| 288 | - 'em' => [ | |
| 289 | - 'max' => 2, | |
| 290 | - ], | |
| 291 | 252 | ], |
| 292 | 253 | 'selectors' => [ |
| 293 | 254 | '{{WRAPPER}} .elementor-accordion-item' => 'border-width: {{SIZE}}{{UNIT}};', |
| 294 | 255 | '{{WRAPPER}} .elementor-accordion-item .elementor-tab-content' => 'border-width: {{SIZE}}{{UNIT}};', |
| @@ -299,14 +260,14 @@ | ||
| 299 | 260 | |
| 300 | 261 | $this->add_control( |
| 301 | 262 | 'border_color', |
| 302 | 263 | [ |
| 303 | - 'label' => esc_html__( 'Border Color', 'elementor' ), | |
| 264 | + 'label' => __( 'Border Color', 'elementor' ), | |
| 304 | 265 | 'type' => Controls_Manager::COLOR, |
| 305 | 266 | 'selectors' => [ |
| 306 | 267 | '{{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}};', | |
| 268 | + '{{WRAPPER}} .elementor-accordion-item .elementor-tab-content' => 'border-top-color: {{VALUE}};', | |
| 269 | + '{{WRAPPER}} .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-bottom-color: {{VALUE}};', | |
| 309 | 270 | ], |
| 310 | 271 | ] |
| 311 | 272 | ); |
| 312 | 273 | |
| @@ -314,9 +275,9 @@ | ||
| 314 | 275 | |
| 315 | 276 | $this->start_controls_section( |
| 316 | 277 | 'section_toggle_style_title', |
| 317 | 278 | [ |
| 318 | - 'label' => esc_html__( 'Title', 'elementor' ), | |
| 279 | + 'label' => __( 'Title', 'elementor' ), | |
| 319 | 280 | 'tab' => Controls_Manager::TAB_STYLE, |
| 320 | 281 | ] |
| 321 | 282 | ); |
| 322 | 283 | |
| @@ -322,9 +283,9 @@ | ||
| 322 | 283 | |
| 323 | 284 | $this->add_control( |
| 324 | 285 | 'title_background', |
| 325 | 286 | [ |
| 326 | - 'label' => esc_html__( 'Background', 'elementor' ), | |
| 287 | + 'label' => __( 'Background', 'elementor' ), | |
| 327 | 288 | 'type' => Controls_Manager::COLOR, |
| 328 | 289 | 'selectors' => [ |
| 329 | 290 | '{{WRAPPER}} .elementor-tab-title' => 'background-color: {{VALUE}};', |
| 330 | 291 | ], |
| @@ -333,13 +294,12 @@ | ||
| 333 | 294 | |
| 334 | 295 | $this->add_control( |
| 335 | 296 | 'title_color', |
| 336 | 297 | [ |
| 337 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 298 | + 'label' => __( 'Color', 'elementor' ), | |
| 338 | 299 | 'type' => Controls_Manager::COLOR, |
| 339 | 300 | 'selectors' => [ |
| 340 | 301 | '{{WRAPPER}} .elementor-accordion-icon, {{WRAPPER}} .elementor-accordion-title' => 'color: {{VALUE}};', |
| 341 | - '{{WRAPPER}} .elementor-accordion-icon svg' => 'fill: {{VALUE}};', | |
| 342 | 302 | ], |
| 343 | 303 | 'global' => [ |
| 344 | 304 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 345 | 305 | ], |
| @@ -348,13 +308,12 @@ | ||
| 348 | 308 | |
| 349 | 309 | $this->add_control( |
| 350 | 310 | 'tab_active_color', |
| 351 | 311 | [ |
| 352 | - 'label' => esc_html__( 'Active Color', 'elementor' ), | |
| 312 | + 'label' => __( 'Active Color', 'elementor' ), | |
| 353 | 313 | 'type' => Controls_Manager::COLOR, |
| 354 | 314 | 'selectors' => [ |
| 355 | 315 | '{{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 | 316 | ], |
| 358 | 317 | 'global' => [ |
| 359 | 318 | 'default' => Global_Colors::COLOR_ACCENT, |
| 360 | 319 | ], |
| @@ -372,16 +331,8 @@ | ||
| 372 | 331 | ] |
| 373 | 332 | ); |
| 374 | 333 | |
| 375 | 334 | $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 | 335 | Group_Control_Text_Shadow::get_type(), |
| 385 | 336 | [ |
| 386 | 337 | 'name' => 'title_shadow', |
| 387 | 338 | 'selector' => '{{WRAPPER}} .elementor-accordion-title', |
| @@ -390,11 +341,11 @@ | ||
| 390 | 341 | |
| 391 | 342 | $this->add_responsive_control( |
| 392 | 343 | 'title_padding', |
| 393 | 344 | [ |
| 394 | - 'label' => esc_html__( 'Padding', 'elementor' ), | |
| 345 | + 'label' => __( 'Padding', 'elementor' ), | |
| 395 | 346 | 'type' => Controls_Manager::DIMENSIONS, |
| 396 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 347 | + 'size_units' => [ 'px', 'em', '%' ], | |
| 397 | 348 | 'selectors' => [ |
| 398 | 349 | '{{WRAPPER}} .elementor-tab-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 399 | 350 | ], |
| 400 | 351 | ] |
| @@ -404,9 +355,9 @@ | ||
| 404 | 355 | |
| 405 | 356 | $this->start_controls_section( |
| 406 | 357 | 'section_toggle_style_icon', |
| 407 | 358 | [ |
| 408 | - 'label' => esc_html__( 'Icon', 'elementor' ), | |
| 359 | + 'label' => __( 'Icon', 'elementor' ), | |
| 409 | 360 | 'tab' => Controls_Manager::TAB_STYLE, |
| 410 | 361 | 'condition' => [ |
| 411 | 362 | 'selected_icon[value]!' => '', |
| 412 | 363 | ], |
| @@ -415,17 +366,17 @@ | ||
| 415 | 366 | |
| 416 | 367 | $this->add_control( |
| 417 | 368 | 'icon_align', |
| 418 | 369 | [ |
| 419 | - 'label' => esc_html__( 'Alignment', 'elementor' ), | |
| 370 | + 'label' => __( 'Alignment', 'elementor' ), | |
| 420 | 371 | 'type' => Controls_Manager::CHOOSE, |
| 421 | 372 | 'options' => [ |
| 422 | 373 | 'left' => [ |
| 423 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 374 | + 'title' => __( 'Start', 'elementor' ), | |
| 424 | 375 | 'icon' => 'eicon-h-align-left', |
| 425 | 376 | ], |
| 426 | 377 | 'right' => [ |
| 427 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 378 | + 'title' => __( 'End', 'elementor' ), | |
| 428 | 379 | 'icon' => 'eicon-h-align-right', |
| 429 | 380 | ], |
| 430 | 381 | ], |
| 431 | 382 | 'default' => is_rtl() ? 'right' : 'left', |
| @@ -435,9 +386,9 @@ | ||
| 435 | 386 | |
| 436 | 387 | $this->add_control( |
| 437 | 388 | 'icon_color', |
| 438 | 389 | [ |
| 439 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 390 | + 'label' => __( 'Color', 'elementor' ), | |
| 440 | 391 | 'type' => Controls_Manager::COLOR, |
| 441 | 392 | 'selectors' => [ |
| 442 | 393 | '{{WRAPPER}} .elementor-tab-title .elementor-accordion-icon i:before' => 'color: {{VALUE}};', |
| 443 | 394 | '{{WRAPPER}} .elementor-tab-title .elementor-accordion-icon svg' => 'fill: {{VALUE}};', |
| @@ -447,9 +398,9 @@ | ||
| 447 | 398 | |
| 448 | 399 | $this->add_control( |
| 449 | 400 | 'icon_active_color', |
| 450 | 401 | [ |
| 451 | - 'label' => esc_html__( 'Active Color', 'elementor' ), | |
| 402 | + 'label' => __( 'Active Color', 'elementor' ), | |
| 452 | 403 | 'type' => Controls_Manager::COLOR, |
| 453 | 404 | 'selectors' => [ |
| 454 | 405 | '{{WRAPPER}} .elementor-tab-title.elementor-active .elementor-accordion-icon i:before' => 'color: {{VALUE}};', |
| 455 | 406 | '{{WRAPPER}} .elementor-tab-title.elementor-active .elementor-accordion-icon svg' => 'fill: {{VALUE}};', |
| @@ -459,24 +410,19 @@ | ||
| 459 | 410 | |
| 460 | 411 | $this->add_responsive_control( |
| 461 | 412 | 'icon_space', |
| 462 | 413 | [ |
| 463 | - 'label' => esc_html__( 'Spacing', 'elementor' ), | |
| 414 | + 'label' => __( 'Spacing', 'elementor' ), | |
| 464 | 415 | 'type' => Controls_Manager::SLIDER, |
| 465 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 466 | 416 | 'range' => [ |
| 467 | 417 | 'px' => [ |
| 418 | + 'min' => 0, | |
| 468 | 419 | 'max' => 100, |
| 469 | 420 | ], |
| 470 | - 'em' => [ | |
| 471 | - 'max' => 1, | |
| 472 | - ], | |
| 473 | - 'rem' => [ | |
| 474 | - 'max' => 1, | |
| 475 | - ], | |
| 476 | 421 | ], |
| 477 | 422 | 'selectors' => [ |
| 478 | - '{{WRAPPER}} .elementor-accordion-icon' => 'margin-inline-end: {{SIZE}}{{UNIT}};', | |
| 423 | + '{{WRAPPER}} .elementor-accordion-icon.elementor-accordion-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 424 | + '{{WRAPPER}} .elementor-accordion-icon.elementor-accordion-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', | |
| 479 | 425 | ], |
| 480 | 426 | ] |
| 481 | 427 | ); |
| 482 | 428 | |
| @@ -484,9 +430,9 @@ | ||
| 484 | 430 | |
| 485 | 431 | $this->start_controls_section( |
| 486 | 432 | 'section_toggle_style_content', |
| 487 | 433 | [ |
| 488 | - 'label' => esc_html__( 'Content', 'elementor' ), | |
| 434 | + 'label' => __( 'Content', 'elementor' ), | |
| 489 | 435 | 'tab' => Controls_Manager::TAB_STYLE, |
| 490 | 436 | ] |
| 491 | 437 | ); |
| 492 | 438 | |
| @@ -492,9 +438,9 @@ | ||
| 492 | 438 | |
| 493 | 439 | $this->add_control( |
| 494 | 440 | 'content_background_color', |
| 495 | 441 | [ |
| 496 | - 'label' => esc_html__( 'Background', 'elementor' ), | |
| 442 | + 'label' => __( 'Background', 'elementor' ), | |
| 497 | 443 | 'type' => Controls_Manager::COLOR, |
| 498 | 444 | 'selectors' => [ |
| 499 | 445 | '{{WRAPPER}} .elementor-tab-content' => 'background-color: {{VALUE}};', |
| 500 | 446 | ], |
| @@ -503,9 +449,9 @@ | ||
| 503 | 449 | |
| 504 | 450 | $this->add_control( |
| 505 | 451 | 'content_color', |
| 506 | 452 | [ |
| 507 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 453 | + 'label' => __( 'Color', 'elementor' ), | |
| 508 | 454 | 'type' => Controls_Manager::COLOR, |
| 509 | 455 | 'selectors' => [ |
| 510 | 456 | '{{WRAPPER}} .elementor-tab-content' => 'color: {{VALUE}};', |
| 511 | 457 | ], |
| @@ -536,11 +482,11 @@ | ||
| 536 | 482 | |
| 537 | 483 | $this->add_responsive_control( |
| 538 | 484 | 'content_padding', |
| 539 | 485 | [ |
| 540 | - 'label' => esc_html__( 'Padding', 'elementor' ), | |
| 486 | + 'label' => __( 'Padding', 'elementor' ), | |
| 541 | 487 | 'type' => Controls_Manager::DIMENSIONS, |
| 542 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 488 | + 'size_units' => [ 'px', 'em', '%' ], | |
| 543 | 489 | 'selectors' => [ |
| 544 | 490 | '{{WRAPPER}} .elementor-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 545 | 491 | ], |
| 546 | 492 | ] |
| @@ -573,9 +519,9 @@ | ||
| 573 | 519 | $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); |
| 574 | 520 | $has_icon = ( ! $is_new || ! empty( $settings['selected_icon']['value'] ) ); |
| 575 | 521 | $id_int = substr( $this->get_id_int(), 0, 3 ); |
| 576 | 522 | ?> |
| 577 | - <div class="elementor-accordion"> | |
| 523 | + <div class="elementor-accordion" role="tablist"> | |
| 578 | 524 | <?php |
| 579 | 525 | foreach ( $settings['tabs'] as $index => $item ) : |
| 580 | 526 | $tab_count = $index + 1; |
| 581 | 527 | |
| @@ -586,9 +532,9 @@ | ||
| 586 | 532 | $this->add_render_attribute( $tab_title_setting_key, [ |
| 587 | 533 | 'id' => 'elementor-tab-title-' . $id_int . $tab_count, |
| 588 | 534 | 'class' => [ 'elementor-tab-title' ], |
| 589 | 535 | 'data-tab' => $tab_count, |
| 590 | - 'role' => 'button', | |
| 536 | + 'role' => 'tab', | |
| 591 | 537 | 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count, |
| 592 | 538 | 'aria-expanded' => 'false', |
| 593 | 539 | ] ); |
| 594 | 540 | |
| @@ -595,9 +541,9 @@ | ||
| 595 | 541 | $this->add_render_attribute( $tab_content_setting_key, [ |
| 596 | 542 | 'id' => 'elementor-tab-content-' . $id_int . $tab_count, |
| 597 | 543 | 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ], |
| 598 | 544 | 'data-tab' => $tab_count, |
| 599 | - 'role' => 'region', | |
| 545 | + 'role' => 'tabpanel', | |
| 600 | 546 | 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count, |
| 601 | 547 | ] ); |
| 602 | 548 | |
| 603 | 549 | $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); |
| @@ -602,9 +548,9 @@ | ||
| 602 | 548 | |
| 603 | 549 | $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); |
| 604 | 550 | ?> |
| 605 | 551 | <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 ); ?>> | |
| 552 | + <<?php echo Utils::validate_html_tag( $settings['title_html_tag'] ); ?> <?php echo $this->get_render_attribute_string( $tab_title_setting_key ); ?>> | |
| 607 | 553 | <?php if ( $has_icon ) : ?> |
| 608 | 554 | <span class="elementor-accordion-icon elementor-accordion-icon-<?php echo esc_attr( $settings['icon_align'] ); ?>" aria-hidden="true"> |
| 609 | 555 | <?php |
| 610 | 556 | if ( $is_new || $migrated ) { ?> |
| @@ -615,15 +561,11 @@ | ||
| 615 | 561 | <i class="elementor-accordion-icon-opened <?php echo esc_attr( $settings['icon_active'] ); ?>"></i> |
| 616 | 562 | <?php } ?> |
| 617 | 563 | </span> |
| 618 | 564 | <?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> | |
| 565 | + <a class="elementor-accordion-title" href=""><?php echo $item['tab_title']; ?></a> | |
| 566 | + </<?php echo Utils::validate_html_tag( $settings['title_html_tag'] ); ?>> | |
| 567 | + <div <?php echo $this->get_render_attribute_string( $tab_content_setting_key ); ?>><?php echo $this->parse_text_editor( $item['tab_content'] ); ?></div> | |
| 626 | 568 | </div> |
| 627 | 569 | <?php endforeach; ?> |
| 628 | 570 | <?php |
| 629 | 571 | if ( isset( $settings['faq_schema'] ) && 'yes' === $settings['faq_schema'] ) { |
| @@ -657,40 +599,11 @@ | ||
| 657 | 599 | * |
| 658 | 600 | * @since 2.9.0 |
| 659 | 601 | * @access protected |
| 660 | 602 | */ |
| 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 | 603 | protected function content_template() { |
| 691 | 604 | ?> |
| 692 | - <div class="elementor-accordion"> | |
| 605 | + <div class="elementor-accordion" role="tablist"> | |
| 693 | 606 | <# |
| 694 | 607 | if ( settings.tabs ) { |
| 695 | 608 | var tabindex = view.getIDInt().toString().substr( 0, 3 ), |
| 696 | 609 | iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, {}, 'i' , 'object' ), |
| @@ -706,9 +619,9 @@ | ||
| 706 | 619 | 'id': 'elementor-tab-title-' + tabindex + tabCount, |
| 707 | 620 | 'class': [ 'elementor-tab-title' ], |
| 708 | 621 | 'tabindex': tabindex + tabCount, |
| 709 | 622 | 'data-tab': tabCount, |
| 710 | - 'role': 'button', | |
| 623 | + 'role': 'tab', | |
| 711 | 624 | 'aria-controls': 'elementor-tab-content-' + tabindex + tabCount, |
| 712 | 625 | 'aria-expanded': 'false', |
| 713 | 626 | } ); |
| 714 | 627 | |
| @@ -715,9 +628,9 @@ | ||
| 715 | 628 | view.addRenderAttribute( tabContentKey, { |
| 716 | 629 | 'id': 'elementor-tab-content-' + tabindex + tabCount, |
| 717 | 630 | 'class': [ 'elementor-tab-content', 'elementor-clearfix' ], |
| 718 | 631 | 'data-tab': tabCount, |
| 719 | - 'role': 'region', | |
| 632 | + 'role': 'tabpanel', | |
| 720 | 633 | 'aria-labelledby': 'elementor-tab-title-' + tabindex + tabCount |
| 721 | 634 | } ); |
| 722 | 635 | |
| 723 | 636 | view.addInlineEditingAttributes( tabContentKey, 'advanced' ); |
| @@ -736,9 +649,9 @@ | ||
| 736 | 649 | <i class="elementor-accordion-icon-opened {{ settings.icon_active }}"></i> |
| 737 | 650 | <# } #> |
| 738 | 651 | </span> |
| 739 | 652 | <# } #> |
| 740 | - <a class="elementor-accordion-title" tabindex="0">{{{ item.tab_title }}}</a> | |
| 653 | + <a class="elementor-accordion-title" href="">{{{ item.tab_title }}}</a> | |
| 741 | 654 | </{{{ titleHTMLTag }}}> |
| 742 | 655 | <div {{{ view.getRenderAttributeString( tabContentKey ) }}}>{{{ item.tab_content }}}</div> |
| 743 | 656 | </div> |
| 744 | 657 | <# |