Widget_Accordion::render()
Render accordion widget output on the frontend.
Description
Written in PHP and used to generate the final HTML.
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
Source
includes/widgets/accordion.php
$this->add_render_attribute( $tab_title_setting_key, [ 'id' => 'elementor-tab-title-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-title' ], 'tabindex' => $id_int . $tab_count, 'data-tab' => $tab_count, 'role' => 'tab', 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count, ] ); $this->add_render_attribute( $tab_content_setting_key, [ 'id' => 'elementor-tab-content-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ], 'data-tab' => $tab_count, 'role' => 'tabpanel', 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count, ] ); $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); ?> <div class="elementor-accordion-item"> <<?php echo $settings['title_html_tag']; ?> <?php echo $this->get_render_attribute_string( $tab_title_setting_key ); ?>> <?php if ( $settings['icon'] ) : ?> <span class="elementor-accordion-icon elementor-accordion-icon-<?php echo esc_attr( $settings['icon_align'] ); ?>" aria-hidden="true"> <i class="elementor-accordion-icon-closed <?php echo esc_attr( $settings['icon'] ); ?>"></i> <i class="elementor-accordion-icon-opened <?php echo esc_attr( $settings['icon_active'] ); ?>"></i> </span> <?php endif; ?> <?php echo $item['tab_title']; ?> </<?php echo $settings['title_html_tag']; ?>> <div <?php echo $this->get_render_attribute_string( $tab_content_setting_key ); ?>><?php echo $this->parse_text_editor( $item['tab_content'] ); ?></div> </div> <?php endforeach; ?> </div> <?php } /** * Render accordion widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 1.0.0 * @access protected */ protected function _content_template() { ?> <div class="elementor-accordion" role="tablist"> <#