Widget_Icon::render()
Render icon 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.php
$this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_section(); } /** * Render icon widget output on the frontend. * * 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( 'wrapper', 'class', 'elementor-icon-wrapper' ); $this->add_render_attribute( 'icon-wrapper', 'class', 'elementor-icon' ); if ( ! empty( $settings['hover_animation'] ) ) { $this->add_render_attribute( 'icon-wrapper', 'class', 'elementor-animation-' . $settings['hover_animation'] ); } $icon_tag = 'div'; if ( ! empty( $settings['link']['url'] ) ) { $this->add_render_attribute( 'icon-wrapper', 'href', $settings['link']['url'] ); $icon_tag = 'a'; if ( ! empty( $settings['link']['is_external'] ) ) { $this->add_render_attribute( 'icon-wrapper', 'target', '_blank' ); }