Widget_Icon_Box::render()
Render icon box 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/icon-box.php
* * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( 'icon', 'class', [ 'elementor-icon', 'elementor-animation-' . $settings['hover_animation'] ] ); $icon_tag = 'span'; $has_icon = ! empty( $settings['icon'] ); if ( ! empty( $settings['link']['url'] ) ) { $this->add_render_attribute( 'link', 'href', $settings['link']['url'] ); $icon_tag = 'a'; if ( $settings['link']['is_external'] ) { $this->add_render_attribute( 'link', 'target', '_blank' ); } if ( $settings['link']['nofollow'] ) { $this->add_render_attribute( 'link', 'rel', 'nofollow' ); } } if ( $has_icon ) { $this->add_render_attribute( 'i', 'class', $settings['icon'] ); $this->add_render_attribute( 'i', 'aria-hidden', 'true' ); } $icon_attributes = $this->get_render_attribute_string( 'icon' ); $link_attributes = $this->get_render_attribute_string( 'link' ); $this->add_render_attribute( 'description_text', 'class', 'elementor-icon-box-description' ); $this->add_inline_editing_attributes( 'title_text', 'none' ); $this->add_inline_editing_attributes( 'description_text' ); ?> <div class="elementor-icon-box-wrapper"> <?php if ( $has_icon ) : ?> <div class="elementor-icon-box-icon"> <<?php echo implode( ' ', [ $icon_tag, $icon_attributes, $link_attributes ] ); ?>>