PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.9
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.9
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / inc / admin / widget-builder / icon-render-helper.php

icon-render-helper.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.9, at inc/admin/widget-builder/icon-render-helper.php

42 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Helper for rendering Elementor Icons in widgets
4 *
5 * Usage in widget render method:
6 * \Elementor\Icons_Manager::render_icon( $settings['icon_field_name'], [ 'aria-hidden' => 'true' ] );
7 */
8
9 // Example of how to properly render an icon in the widget's render_widget_content method:
10 /*
11 protected function render_widget_content($settings) {
12 ?>
13 <div class="icon-holder">
14 <?php
15 // Check if icon is set
16 if ( ! empty( $settings['jltma_advanced_icons_28']['value'] ) ) {
17 \Elementor\Icons_Manager::render_icon( $settings['jltma_advanced_icons_28'], [ 'aria-hidden' => 'true' ] );
18 }
19 ?>
20 </div>
21 <?php
22 }
23 */
24
25 // Alternative method using the icon HTML directly:
26 /*
27 protected function render_widget_content($settings) {
28 ?>
29 <div class="icon-holder">
30 <?php
31 // Check if icon is set
32 if ( ! empty( $settings['jltma_advanced_icons_28']['value'] ) ) {
33 // For Font Awesome or other icon fonts
34 if ( ! empty( $settings['jltma_advanced_icons_28']['library'] ) ) {
35 echo '<i class="' . esc_attr( $settings['jltma_advanced_icons_28']['value'] ) . '" aria-hidden="true"></i>';
36 }
37 }
38 ?>
39 </div>
40 <?php
41 }
42 */