| @@ -42,9 +42,9 @@ | ||
| 42 | 42 | * |
| 43 | 43 | * @return string Widget title. |
| 44 | 44 | */ |
| 45 | 45 | public function get_title() { |
| 46 | - return esc_html__( 'Toggle', 'elementor' ); | |
| 46 | + return __( 'Toggle', 'elementor' ); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Get widget icon. |
| @@ -73,43 +73,9 @@ | ||
| 73 | 73 | public function get_keywords() { |
| 74 | 74 | return [ 'tabs', 'accordion', 'toggle' ]; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - protected function is_dynamic_content(): bool { | |
| 78 | - return false; | |
| 79 | - } | |
| 80 | - | |
| 81 | 77 | /** |
| 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-toggle' ]; | |
| 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 | 78 | * Register toggle widget controls. |
| 113 | 79 | * |
| 114 | 80 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 115 | 81 | * |
| @@ -119,9 +85,9 @@ | ||
| 119 | 85 | protected function register_controls() { |
| 120 | 86 | $this->start_controls_section( |
| 121 | 87 | 'section_toggle', |
| 122 | 88 | [ |
| 123 | - 'label' => esc_html__( 'Toggle', 'elementor' ), | |
| 89 | + 'label' => __( 'Toggle', 'elementor' ), | |
| 124 | 90 | ] |
| 125 | 91 | ); |
| 126 | 92 | |
| 127 | 93 | $repeater = new Repeater(); |
| @@ -128,11 +94,11 @@ | ||
| 128 | 94 | |
| 129 | 95 | $repeater->add_control( |
| 130 | 96 | 'tab_title', |
| 131 | 97 | [ |
| 132 | - 'label' => esc_html__( 'Title', 'elementor' ), | |
| 98 | + 'label' => __( 'Title & Description', 'elementor' ), | |
| 133 | 99 | 'type' => Controls_Manager::TEXT, |
| 134 | - 'default' => esc_html__( 'Toggle Title', 'elementor' ), | |
| 100 | + 'default' => __( 'Toggle Title', 'elementor' ), | |
| 135 | 101 | 'label_block' => true, |
| 136 | 102 | 'dynamic' => [ |
| 137 | 103 | 'active' => true, |
| 138 | 104 | ], |
| @@ -141,11 +107,12 @@ | ||
| 141 | 107 | |
| 142 | 108 | $repeater->add_control( |
| 143 | 109 | 'tab_content', |
| 144 | 110 | [ |
| 145 | - 'label' => esc_html__( 'Content', 'elementor' ), | |
| 111 | + 'label' => __( 'Content', 'elementor' ), | |
| 146 | 112 | 'type' => Controls_Manager::WYSIWYG, |
| 147 | - 'default' => esc_html__( 'Toggle Content', 'elementor' ), | |
| 113 | + 'default' => __( 'Toggle Content', 'elementor' ), | |
| 114 | + 'show_label' => false, | |
| 148 | 115 | 'dynamic' => [ |
| 149 | 116 | 'active' => true, |
| 150 | 117 | ], |
| 151 | 118 | ] |
| @@ -150,33 +117,22 @@ | ||
| 150 | 117 | ], |
| 151 | 118 | ] |
| 152 | 119 | ); |
| 153 | 120 | |
| 154 | - if ( Plugin::$instance->widgets_manager->get_widget_types( 'nested-accordion' ) ) { | |
| 155 | - $this->add_deprecation_message( | |
| 156 | - '3.15.0', | |
| 157 | - esc_html__( | |
| 158 | - 'You are currently editing a Toggle widget in its old version. Drag a new Accordion widget onto your page to use a newer version, providing nested capabilities.', | |
| 159 | - 'elementor' | |
| 160 | - ), | |
| 161 | - 'nested-accordion' | |
| 162 | - ); | |
| 163 | - } | |
| 164 | - | |
| 165 | 121 | $this->add_control( |
| 166 | 122 | 'tabs', |
| 167 | 123 | [ |
| 168 | - 'label' => esc_html__( 'Toggle Items', 'elementor' ), | |
| 124 | + 'label' => __( 'Toggle Items', 'elementor' ), | |
| 169 | 125 | 'type' => Controls_Manager::REPEATER, |
| 170 | 126 | 'fields' => $repeater->get_controls(), |
| 171 | 127 | 'default' => [ |
| 172 | 128 | [ |
| 173 | - 'tab_title' => esc_html__( 'Toggle #1', 'elementor' ), | |
| 174 | - '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' => __( 'Toggle #1', 'elementor' ), | |
| 130 | + 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), | |
| 175 | 131 | ], |
| 176 | 132 | [ |
| 177 | - 'tab_title' => esc_html__( 'Toggle #2', 'elementor' ), | |
| 178 | - 'tab_content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), | |
| 133 | + 'tab_title' => __( 'Toggle #2', 'elementor' ), | |
| 134 | + 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), | |
| 179 | 135 | ], |
| 180 | 136 | ], |
| 181 | 137 | 'title_field' => '{{{ tab_title }}}', |
| 182 | 138 | ] |
| @@ -182,11 +138,20 @@ | ||
| 182 | 138 | ] |
| 183 | 139 | ); |
| 184 | 140 | |
| 185 | 141 | $this->add_control( |
| 142 | + 'view', | |
| 143 | + [ | |
| 144 | + 'label' => __( 'View', 'elementor' ), | |
| 145 | + 'type' => Controls_Manager::HIDDEN, | |
| 146 | + 'default' => 'traditional', | |
| 147 | + ] | |
| 148 | + ); | |
| 149 | + | |
| 150 | + $this->add_control( | |
| 186 | 151 | 'selected_icon', |
| 187 | 152 | [ |
| 188 | - 'label' => esc_html__( 'Icon', 'elementor' ), | |
| 153 | + 'label' => __( 'Icon', 'elementor' ), | |
| 189 | 154 | 'type' => Controls_Manager::ICONS, |
| 190 | 155 | 'separator' => 'before', |
| 191 | 156 | 'fa4compatibility' => 'icon', |
| 192 | 157 | 'default' => [ |
| @@ -212,9 +177,9 @@ | ||
| 212 | 177 | |
| 213 | 178 | $this->add_control( |
| 214 | 179 | 'selected_active_icon', |
| 215 | 180 | [ |
| 216 | - 'label' => esc_html__( 'Active Icon', 'elementor' ), | |
| 181 | + 'label' => __( 'Active Icon', 'elementor' ), | |
| 217 | 182 | 'type' => Controls_Manager::ICONS, |
| 218 | 183 | 'fa4compatibility' => 'icon_active', |
| 219 | 184 | 'default' => [ |
| 220 | 185 | 'value' => 'fas fa-caret-up', |
| @@ -242,9 +207,9 @@ | ||
| 242 | 207 | |
| 243 | 208 | $this->add_control( |
| 244 | 209 | 'title_html_tag', |
| 245 | 210 | [ |
| 246 | - 'label' => esc_html__( 'Title HTML Tag', 'elementor' ), | |
| 211 | + 'label' => __( 'Title HTML Tag', 'elementor' ), | |
| 247 | 212 | 'type' => Controls_Manager::SELECT, |
| 248 | 213 | 'options' => [ |
| 249 | 214 | 'h1' => 'H1', |
| 250 | 215 | 'h2' => 'H2', |
| @@ -261,9 +226,9 @@ | ||
| 261 | 226 | |
| 262 | 227 | $this->add_control( |
| 263 | 228 | 'faq_schema', |
| 264 | 229 | [ |
| 265 | - 'label' => esc_html__( 'FAQ Schema', 'elementor' ), | |
| 230 | + 'label' => __( 'FAQ Schema', 'elementor' ), | |
| 266 | 231 | 'type' => Controls_Manager::SWITCHER, |
| 267 | 232 | 'separator' => 'before', |
| 268 | 233 | ] |
| 269 | 234 | ); |
| @@ -272,9 +237,9 @@ | ||
| 272 | 237 | |
| 273 | 238 | $this->start_controls_section( |
| 274 | 239 | 'section_toggle_style', |
| 275 | 240 | [ |
| 276 | - 'label' => esc_html__( 'Toggle', 'elementor' ), | |
| 241 | + 'label' => __( 'Toggle', 'elementor' ), | |
| 277 | 242 | 'tab' => Controls_Manager::TAB_STYLE, |
| 278 | 243 | ] |
| 279 | 244 | ); |
| 280 | 245 | |
| @@ -280,18 +245,15 @@ | ||
| 280 | 245 | |
| 281 | 246 | $this->add_control( |
| 282 | 247 | 'border_width', |
| 283 | 248 | [ |
| 284 | - 'label' => esc_html__( 'Border Width', 'elementor' ), | |
| 249 | + 'label' => __( 'Border Width', 'elementor' ), | |
| 285 | 250 | 'type' => Controls_Manager::SLIDER, |
| 286 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 287 | 251 | 'range' => [ |
| 288 | 252 | 'px' => [ |
| 289 | - 'max' => 20, | |
| 253 | + 'min' => 0, | |
| 254 | + 'max' => 10, | |
| 290 | 255 | ], |
| 291 | - 'em' => [ | |
| 292 | - 'max' => 2, | |
| 293 | - ], | |
| 294 | 256 | ], |
| 295 | 257 | 'selectors' => [ |
| 296 | 258 | '{{WRAPPER}} .elementor-tab-title' => 'border-width: {{SIZE}}{{UNIT}};', |
| 297 | 259 | '{{WRAPPER}} .elementor-tab-content' => 'border-width: {{SIZE}}{{UNIT}};', |
| @@ -301,12 +263,12 @@ | ||
| 301 | 263 | |
| 302 | 264 | $this->add_control( |
| 303 | 265 | 'border_color', |
| 304 | 266 | [ |
| 305 | - 'label' => esc_html__( 'Border Color', 'elementor' ), | |
| 267 | + 'label' => __( 'Border Color', 'elementor' ), | |
| 306 | 268 | 'type' => Controls_Manager::COLOR, |
| 307 | 269 | 'selectors' => [ |
| 308 | - '{{WRAPPER}} .elementor-tab-content' => 'border-block-end-color: {{VALUE}};', | |
| 270 | + '{{WRAPPER}} .elementor-tab-content' => 'border-bottom-color: {{VALUE}};', | |
| 309 | 271 | '{{WRAPPER}} .elementor-tab-title' => 'border-color: {{VALUE}};', |
| 310 | 272 | ], |
| 311 | 273 | ] |
| 312 | 274 | ); |
| @@ -313,24 +275,18 @@ | ||
| 313 | 275 | |
| 314 | 276 | $this->add_responsive_control( |
| 315 | 277 | 'space_between', |
| 316 | 278 | [ |
| 317 | - 'label' => esc_html__( 'Space Between', 'elementor' ), | |
| 279 | + 'label' => __( 'Space Between', 'elementor' ), | |
| 318 | 280 | 'type' => Controls_Manager::SLIDER, |
| 319 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 320 | 281 | 'range' => [ |
| 321 | 282 | 'px' => [ |
| 283 | + 'min' => 0, | |
| 322 | 284 | 'max' => 100, |
| 323 | 285 | ], |
| 324 | - 'em' => [ | |
| 325 | - 'max' => 10, | |
| 326 | - ], | |
| 327 | - 'rem' => [ | |
| 328 | - 'max' => 10, | |
| 329 | - ], | |
| 330 | 286 | ], |
| 331 | 287 | 'selectors' => [ |
| 332 | - '{{WRAPPER}} .elementor-toggle-item:not(:last-child)' => 'margin-block-end: {{SIZE}}{{UNIT}}', | |
| 288 | + '{{WRAPPER}} .elementor-toggle-item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}', | |
| 333 | 289 | ], |
| 334 | 290 | ] |
| 335 | 291 | ); |
| 336 | 292 | |
| @@ -346,9 +302,9 @@ | ||
| 346 | 302 | |
| 347 | 303 | $this->start_controls_section( |
| 348 | 304 | 'section_toggle_style_title', |
| 349 | 305 | [ |
| 350 | - 'label' => esc_html__( 'Title', 'elementor' ), | |
| 306 | + 'label' => __( 'Title', 'elementor' ), | |
| 351 | 307 | 'tab' => Controls_Manager::TAB_STYLE, |
| 352 | 308 | ] |
| 353 | 309 | ); |
| 354 | 310 | |
| @@ -354,9 +310,9 @@ | ||
| 354 | 310 | |
| 355 | 311 | $this->add_control( |
| 356 | 312 | 'title_background', |
| 357 | 313 | [ |
| 358 | - 'label' => esc_html__( 'Background', 'elementor' ), | |
| 314 | + 'label' => __( 'Background', 'elementor' ), | |
| 359 | 315 | 'type' => Controls_Manager::COLOR, |
| 360 | 316 | 'selectors' => [ |
| 361 | 317 | '{{WRAPPER}} .elementor-tab-title' => 'background-color: {{VALUE}};', |
| 362 | 318 | ], |
| @@ -366,13 +322,12 @@ | ||
| 366 | 322 | // The title selector specificity is to override Theme Style |
| 367 | 323 | $this->add_control( |
| 368 | 324 | 'title_color', |
| 369 | 325 | [ |
| 370 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 326 | + 'label' => __( 'Color', 'elementor' ), | |
| 371 | 327 | 'type' => Controls_Manager::COLOR, |
| 372 | 328 | 'selectors' => [ |
| 373 | 329 | '{{WRAPPER}} .elementor-toggle-title, {{WRAPPER}} .elementor-toggle-icon' => 'color: {{VALUE}};', |
| 374 | - '{{WRAPPER}} .elementor-toggle-icon svg' => 'fill: {{VALUE}};', | |
| 375 | 330 | ], |
| 376 | 331 | 'global' => [ |
| 377 | 332 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 378 | 333 | ], |
| @@ -381,9 +336,9 @@ | ||
| 381 | 336 | |
| 382 | 337 | $this->add_control( |
| 383 | 338 | 'tab_active_color', |
| 384 | 339 | [ |
| 385 | - 'label' => esc_html__( 'Active Color', 'elementor' ), | |
| 340 | + 'label' => __( 'Active Color', 'elementor' ), | |
| 386 | 341 | 'type' => Controls_Manager::COLOR, |
| 387 | 342 | 'selectors' => [ |
| 388 | 343 | '{{WRAPPER}} .elementor-tab-title.elementor-active a, {{WRAPPER}} .elementor-tab-title.elementor-active .elementor-toggle-icon' => 'color: {{VALUE}};', |
| 389 | 344 | ], |
| @@ -414,11 +369,11 @@ | ||
| 414 | 369 | |
| 415 | 370 | $this->add_responsive_control( |
| 416 | 371 | 'title_padding', |
| 417 | 372 | [ |
| 418 | - 'label' => esc_html__( 'Padding', 'elementor' ), | |
| 373 | + 'label' => __( 'Padding', 'elementor' ), | |
| 419 | 374 | 'type' => Controls_Manager::DIMENSIONS, |
| 420 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 375 | + 'size_units' => [ 'px', 'em', '%' ], | |
| 421 | 376 | 'selectors' => [ |
| 422 | 377 | '{{WRAPPER}} .elementor-tab-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 423 | 378 | ], |
| 424 | 379 | ] |
| @@ -428,9 +383,9 @@ | ||
| 428 | 383 | |
| 429 | 384 | $this->start_controls_section( |
| 430 | 385 | 'section_toggle_style_icon', |
| 431 | 386 | [ |
| 432 | - 'label' => esc_html__( 'Icon', 'elementor' ), | |
| 387 | + 'label' => __( 'Icon', 'elementor' ), | |
| 433 | 388 | 'tab' => Controls_Manager::TAB_STYLE, |
| 434 | 389 | 'condition' => [ |
| 435 | 390 | 'selected_icon[value]!' => '', |
| 436 | 391 | ], |
| @@ -439,17 +394,17 @@ | ||
| 439 | 394 | |
| 440 | 395 | $this->add_control( |
| 441 | 396 | 'icon_align', |
| 442 | 397 | [ |
| 443 | - 'label' => esc_html__( 'Alignment', 'elementor' ), | |
| 398 | + 'label' => __( 'Alignment', 'elementor' ), | |
| 444 | 399 | 'type' => Controls_Manager::CHOOSE, |
| 445 | 400 | 'options' => [ |
| 446 | 401 | 'left' => [ |
| 447 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 402 | + 'title' => __( 'Start', 'elementor' ), | |
| 448 | 403 | 'icon' => 'eicon-h-align-left', |
| 449 | 404 | ], |
| 450 | 405 | 'right' => [ |
| 451 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 406 | + 'title' => __( 'End', 'elementor' ), | |
| 452 | 407 | 'icon' => 'eicon-h-align-right', |
| 453 | 408 | ], |
| 454 | 409 | ], |
| 455 | 410 | 'default' => is_rtl() ? 'right' : 'left', |
| @@ -459,9 +414,9 @@ | ||
| 459 | 414 | |
| 460 | 415 | $this->add_control( |
| 461 | 416 | 'icon_color', |
| 462 | 417 | [ |
| 463 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 418 | + 'label' => __( 'Color', 'elementor' ), | |
| 464 | 419 | 'type' => Controls_Manager::COLOR, |
| 465 | 420 | 'selectors' => [ |
| 466 | 421 | '{{WRAPPER}} .elementor-tab-title .elementor-toggle-icon i:before' => 'color: {{VALUE}};', |
| 467 | 422 | '{{WRAPPER}} .elementor-tab-title .elementor-toggle-icon svg' => 'fill: {{VALUE}};', |
| @@ -471,9 +426,9 @@ | ||
| 471 | 426 | |
| 472 | 427 | $this->add_control( |
| 473 | 428 | 'icon_active_color', |
| 474 | 429 | [ |
| 475 | - 'label' => esc_html__( 'Active Color', 'elementor' ), | |
| 430 | + 'label' => __( 'Active Color', 'elementor' ), | |
| 476 | 431 | 'type' => Controls_Manager::COLOR, |
| 477 | 432 | 'selectors' => [ |
| 478 | 433 | '{{WRAPPER}} .elementor-tab-title.elementor-active .elementor-toggle-icon i:before' => 'color: {{VALUE}};', |
| 479 | 434 | '{{WRAPPER}} .elementor-tab-title.elementor-active .elementor-toggle-icon svg' => 'fill: {{VALUE}};', |
| @@ -483,24 +438,19 @@ | ||
| 483 | 438 | |
| 484 | 439 | $this->add_responsive_control( |
| 485 | 440 | 'icon_space', |
| 486 | 441 | [ |
| 487 | - 'label' => esc_html__( 'Spacing', 'elementor' ), | |
| 442 | + 'label' => __( 'Spacing', 'elementor' ), | |
| 488 | 443 | 'type' => Controls_Manager::SLIDER, |
| 489 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 490 | 444 | 'range' => [ |
| 491 | 445 | 'px' => [ |
| 446 | + 'min' => 0, | |
| 492 | 447 | 'max' => 100, |
| 493 | 448 | ], |
| 494 | - 'em' => [ | |
| 495 | - 'max' => 10, | |
| 496 | - ], | |
| 497 | - 'rem' => [ | |
| 498 | - 'max' => 10, | |
| 499 | - ], | |
| 500 | 449 | ], |
| 501 | 450 | 'selectors' => [ |
| 502 | - '{{WRAPPER}} .elementor-toggle-icon' => 'margin-inline-end: {{SIZE}}{{UNIT}};', | |
| 451 | + '{{WRAPPER}} .elementor-toggle-icon.elementor-toggle-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 452 | + '{{WRAPPER}} .elementor-toggle-icon.elementor-toggle-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', | |
| 503 | 453 | ], |
| 504 | 454 | ] |
| 505 | 455 | ); |
| 506 | 456 | |
| @@ -508,9 +458,9 @@ | ||
| 508 | 458 | |
| 509 | 459 | $this->start_controls_section( |
| 510 | 460 | 'section_toggle_style_content', |
| 511 | 461 | [ |
| 512 | - 'label' => esc_html__( 'Content', 'elementor' ), | |
| 462 | + 'label' => __( 'Content', 'elementor' ), | |
| 513 | 463 | 'tab' => Controls_Manager::TAB_STYLE, |
| 514 | 464 | ] |
| 515 | 465 | ); |
| 516 | 466 | |
| @@ -516,9 +466,9 @@ | ||
| 516 | 466 | |
| 517 | 467 | $this->add_control( |
| 518 | 468 | 'content_background_color', |
| 519 | 469 | [ |
| 520 | - 'label' => esc_html__( 'Background', 'elementor' ), | |
| 470 | + 'label' => __( 'Background', 'elementor' ), | |
| 521 | 471 | 'type' => Controls_Manager::COLOR, |
| 522 | 472 | 'selectors' => [ |
| 523 | 473 | '{{WRAPPER}} .elementor-tab-content' => 'background-color: {{VALUE}};', |
| 524 | 474 | ], |
| @@ -527,9 +477,9 @@ | ||
| 527 | 477 | |
| 528 | 478 | $this->add_control( |
| 529 | 479 | 'content_color', |
| 530 | 480 | [ |
| 531 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 481 | + 'label' => __( 'Color', 'elementor' ), | |
| 532 | 482 | 'type' => Controls_Manager::COLOR, |
| 533 | 483 | 'selectors' => [ |
| 534 | 484 | '{{WRAPPER}} .elementor-tab-content' => 'color: {{VALUE}};', |
| 535 | 485 | ], |
| @@ -560,11 +510,11 @@ | ||
| 560 | 510 | |
| 561 | 511 | $this->add_responsive_control( |
| 562 | 512 | 'content_padding', |
| 563 | 513 | [ |
| 564 | - 'label' => esc_html__( 'Padding', 'elementor' ), | |
| 514 | + 'label' => __( 'Padding', 'elementor' ), | |
| 565 | 515 | 'type' => Controls_Manager::DIMENSIONS, |
| 566 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 516 | + 'size_units' => [ 'px', 'em', '%' ], | |
| 567 | 517 | 'selectors' => [ |
| 568 | 518 | '{{WRAPPER}} .elementor-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 569 | 519 | ], |
| 570 | 520 | ] |
| @@ -599,9 +549,9 @@ | ||
| 599 | 549 | $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); |
| 600 | 550 | $has_icon = ( ! $is_new || ! empty( $settings['selected_icon']['value'] ) ); |
| 601 | 551 | |
| 602 | 552 | ?> |
| 603 | - <div class="elementor-toggle"> | |
| 553 | + <div class="elementor-toggle" role="tablist"> | |
| 604 | 554 | <?php |
| 605 | 555 | foreach ( $settings['tabs'] as $index => $item ) : |
| 606 | 556 | $tab_count = $index + 1; |
| 607 | 557 | |
| @@ -612,9 +562,9 @@ | ||
| 612 | 562 | $this->add_render_attribute( $tab_title_setting_key, [ |
| 613 | 563 | 'id' => 'elementor-tab-title-' . $id_int . $tab_count, |
| 614 | 564 | 'class' => [ 'elementor-tab-title' ], |
| 615 | 565 | 'data-tab' => $tab_count, |
| 616 | - 'role' => 'button', | |
| 566 | + 'role' => 'tab', | |
| 617 | 567 | 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count, |
| 618 | 568 | 'aria-expanded' => 'false', |
| 619 | 569 | ] ); |
| 620 | 570 | |
| @@ -621,9 +571,9 @@ | ||
| 621 | 571 | $this->add_render_attribute( $tab_content_setting_key, [ |
| 622 | 572 | 'id' => 'elementor-tab-content-' . $id_int . $tab_count, |
| 623 | 573 | 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ], |
| 624 | 574 | 'data-tab' => $tab_count, |
| 625 | - 'role' => 'region', | |
| 575 | + 'role' => 'tabpanel', | |
| 626 | 576 | 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count, |
| 627 | 577 | ] ); |
| 628 | 578 | |
| 629 | 579 | $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); |
| @@ -628,9 +578,9 @@ | ||
| 628 | 578 | |
| 629 | 579 | $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); |
| 630 | 580 | ?> |
| 631 | 581 | <div class="elementor-toggle-item"> |
| 632 | - <<?php Utils::print_validated_html_tag( $settings['title_html_tag'] ); ?> <?php $this->print_render_attribute_string( $tab_title_setting_key ); ?>> | |
| 582 | + <<?php echo Utils::validate_html_tag( $settings['title_html_tag'] ); ?> <?php echo $this->get_render_attribute_string( $tab_title_setting_key ); ?>> | |
| 633 | 583 | <?php if ( $has_icon ) : ?> |
| 634 | 584 | <span class="elementor-toggle-icon elementor-toggle-icon-<?php echo esc_attr( $settings['icon_align'] ); ?>" aria-hidden="true"> |
| 635 | 585 | <?php |
| 636 | 586 | if ( $is_new || $migrated ) { ?> |
| @@ -641,12 +591,11 @@ | ||
| 641 | 591 | <i class="elementor-toggle-icon-opened <?php echo esc_attr( $settings['icon_active'] ); ?>"></i> |
| 642 | 592 | <?php } ?> |
| 643 | 593 | </span> |
| 644 | 594 | <?php endif; ?> |
| 645 | - <a class="elementor-toggle-title" tabindex="0"><?php $this->print_unescaped_setting( 'tab_title', 'tabs', $index ); ?></a> | |
| 646 | - </<?php Utils::print_validated_html_tag( $settings['title_html_tag'] ); ?>> | |
| 647 | - | |
| 648 | - <div <?php $this->print_render_attribute_string( $tab_content_setting_key ); ?>><?php Utils::print_unescaped_internal_string( $this->parse_text_editor( $item['tab_content'] ) ); ?></div> | |
| 595 | + <a href="" class="elementor-toggle-title"><?php echo $item['tab_title']; ?></a> | |
| 596 | + </<?php echo Utils::validate_html_tag( $settings['title_html_tag'] ); ?>> | |
| 597 | + <div <?php echo $this->get_render_attribute_string( $tab_content_setting_key ); ?>><?php echo $this->parse_text_editor( $item['tab_content'] ); ?></div> | |
| 649 | 598 | </div> |
| 650 | 599 | <?php endforeach; ?> |
| 651 | 600 | <?php |
| 652 | 601 | if ( isset( $settings['faq_schema'] ) && 'yes' === $settings['faq_schema'] ) { |
| @@ -682,9 +631,9 @@ | ||
| 682 | 631 | * @access protected |
| 683 | 632 | */ |
| 684 | 633 | protected function content_template() { |
| 685 | 634 | ?> |
| 686 | - <div class="elementor-toggle"> | |
| 635 | + <div class="elementor-toggle" role="tablist"> | |
| 687 | 636 | <# |
| 688 | 637 | if ( settings.tabs ) { |
| 689 | 638 | var tabindex = view.getIDInt().toString().substr( 0, 3 ), |
| 690 | 639 | iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, {}, 'i' , 'object' ), |
| @@ -700,9 +649,9 @@ | ||
| 700 | 649 | view.addRenderAttribute( tabTitleKey, { |
| 701 | 650 | 'id': 'elementor-tab-title-' + tabindex + tabCount, |
| 702 | 651 | 'class': [ 'elementor-tab-title' ], |
| 703 | 652 | 'data-tab': tabCount, |
| 704 | - 'role': 'button', | |
| 653 | + 'role': 'tab', | |
| 705 | 654 | 'aria-controls': 'elementor-tab-content-' + tabindex + tabCount, |
| 706 | 655 | 'aria-expanded': 'false', |
| 707 | 656 | } ); |
| 708 | 657 | |
| @@ -709,9 +658,9 @@ | ||
| 709 | 658 | view.addRenderAttribute( tabContentKey, { |
| 710 | 659 | 'id': 'elementor-tab-content-' + tabindex + tabCount, |
| 711 | 660 | 'class': [ 'elementor-tab-content', 'elementor-clearfix' ], |
| 712 | 661 | 'data-tab': tabCount, |
| 713 | - 'role': 'region', | |
| 662 | + 'role': 'tabpanel', | |
| 714 | 663 | 'aria-labelledby': 'elementor-tab-title-' + tabindex + tabCount |
| 715 | 664 | } ); |
| 716 | 665 | |
| 717 | 666 | view.addInlineEditingAttributes( tabContentKey, 'advanced' ); |
| @@ -728,9 +677,9 @@ | ||
| 728 | 677 | <i class="elementor-toggle-icon-opened {{ settings.icon_active }}"></i> |
| 729 | 678 | <# } #> |
| 730 | 679 | </span> |
| 731 | 680 | <# } #> |
| 732 | - <a class="elementor-toggle-title" tabindex="0">{{{ item.tab_title }}}</a> | |
| 681 | + <a href="" class="elementor-toggle-title">{{{ item.tab_title }}}</a> | |
| 733 | 682 | </{{{ titleHTMLTag }}}> |
| 734 | 683 | <div {{{ view.getRenderAttributeString( tabContentKey ) }}}>{{{ item.tab_content }}}</div> |
| 735 | 684 | </div> |
| 736 | 685 | <# |
| @@ -737,27 +686,6 @@ | ||
| 737 | 686 | } ); |
| 738 | 687 | } #> |
| 739 | 688 | </div> |
| 740 | 689 | <?php |
| 741 | - } | |
| 742 | - | |
| 743 | - public function render_markdown(): string { | |
| 744 | - $settings = $this->get_settings_for_display(); | |
| 745 | - if ( empty( $settings['tabs'] ) ) { | |
| 746 | - return ''; | |
| 747 | - } | |
| 748 | - $sections = []; | |
| 749 | - foreach ( $settings['tabs'] as $item ) { | |
| 750 | - $title = Utils::html_to_plain_text( $item['tab_title'] ?? '' ); | |
| 751 | - $content = \Elementor\Modules\MarkdownRender\Html_To_Markdown::convert( $item['tab_content'] ?? '' ); | |
| 752 | - if ( empty( $title ) && empty( $content ) ) { | |
| 753 | - continue; | |
| 754 | - } | |
| 755 | - $section = '### ' . $title; | |
| 756 | - if ( ! empty( $content ) ) { | |
| 757 | - $section .= "\n\n" . $content; | |
| 758 | - } | |
| 759 | - $sections[] = $section; | |
| 760 | - } | |
| 761 | - return implode( "\n\n", $sections ); | |
| 762 | 690 | } |
| 763 | 691 | } |