PluginProbe
Elementor Website Builder – more than just a page builder / 3.14.0-beta4
Elementor Website Builder – more than just a page builder v3.14.0-beta4
4.3.4 4.3.3 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 All 457 releases
← All changes | includes/widgets/accordion.php +15 -63 4.2.0 → 3.14.0-beta4 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
@@ -73,27 +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 77 * Hide widget from panel.
97 78 *
98 79 * Hide the toggle widget from the panel if nested-accordion experiment is active.
99 80 *
@@ -100,15 +81,11 @@
100 81 * @since 3.15.0
101 82 * @return bool
102 83 */
103 84 public function show_in_panel(): bool {
104 - return ! Plugin::$instance->experiments->is_feature_active( 'nested-elements', true );
85 + return ! Plugin::$instance->experiments->is_feature_active( 'nested-accordion' );
105 86 }
106 87
107 - public function has_widget_inner_wrapper(): bool {
108 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
109 - }
110 -
111 88 /**
112 89 * Register accordion widget controls.
113 90 *
114 91 * Adds different input fields to allow the user to change and customize the widget settings.
@@ -179,8 +156,17 @@
179 156 ]
180 157 );
181 158
182 159 $this->add_control(
160 + 'view',
161 + [
162 + 'label' => esc_html__( 'View', 'elementor' ),
163 + 'type' => Controls_Manager::HIDDEN,
164 + 'default' => 'traditional',
165 + ]
166 + );
167 +
168 + $this->add_control(
183 169 'selected_icon',
184 170 [
185 171 'label' => esc_html__( 'Icon', 'elementor' ),
186 172 'type' => Controls_Manager::ICONS,
@@ -303,10 +289,10 @@
303 289 'label' => esc_html__( 'Border Color', 'elementor' ),
304 290 'type' => Controls_Manager::COLOR,
305 291 'selectors' => [
306 292 '{{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}};',
293 + '{{WRAPPER}} .elementor-accordion-item .elementor-tab-content' => 'border-top-color: {{VALUE}};',
294 + '{{WRAPPER}} .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-bottom-color: {{VALUE}};',
309 295 ],
310 296 ]
311 297 );
312 298
@@ -461,22 +447,17 @@
461 447 'icon_space',
462 448 [
463 449 'label' => esc_html__( 'Spacing', 'elementor' ),
464 450 'type' => Controls_Manager::SLIDER,
465 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
466 451 'range' => [
467 452 'px' => [
453 + 'min' => 0,
468 454 'max' => 100,
469 455 ],
470 - 'em' => [
471 - 'max' => 1,
472 - ],
473 - 'rem' => [
474 - 'max' => 1,
475 - ],
476 456 ],
477 457 'selectors' => [
478 - '{{WRAPPER}} .elementor-accordion-icon' => 'margin-inline-end: {{SIZE}}{{UNIT}};',
458 + '{{WRAPPER}} .elementor-accordion-icon.elementor-accordion-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
459 + '{{WRAPPER}} .elementor-accordion-icon.elementor-accordion-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
479 460 ],
480 461 ]
481 462 );
482 463
@@ -657,37 +638,8 @@
657 638 *
658 639 * @since 2.9.0
659 640 * @access protected
660 641 */
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 642 protected function content_template() {
691 643 ?>
692 644 <div class="elementor-accordion">
693 645 <#