integration->get_icons_config(); foreach ( $icons_config as $key => $config ) { if ( ! md_icons()->integration->check_if_enabled_icon_style( $key ) ) { continue; } // Dequeue dependency styles on frontend. //if ( ! \Elementor\Plugin::instance()->editor->is_edit_mode() ) { if ( ! is_admin() ) { $config['enqueue'] = array(); } $config['render_callback'] = array( $this, 'render_icon' ); $tabs[ $config['name'] ] = $config; } return $tabs; } public function render_icon( $icon, $attributes, $tag ) { if ( empty( $attributes['class'] ) ) { $attributes['class'] = $icon['value']; } else { if ( is_array( $attributes['class'] ) ) { $attributes['class'][] = $icon['value']; } else { $attributes['class'] .= ' ' . $icon['value']; } } $value = $icon['value']; $value = explode( ' ', $value ); $icon_value = ! empty( $value[1] ) ? $value[1] : false; if ( $icon_value ) { $attributes['data-md-icon'] = str_replace( 'md-', '', $icon_value ); } return '<' . $tag . ' ' . \Elementor\Utils::render_html_attributes( $attributes ) . '>'; } public function custom_icon_render( $res, $icon, $attributes, $tag ) { if ( false === strpos( $icon, 'material-icons' ) || false === strpos( $icon, ' md-' ) ) { return $res; } $value = explode( ' ', $icon ); $icon_value = ! empty( $value[1] ) ? $value[1] : false; if ( $icon_value ) { $attributes['data-md-icon'] = str_replace( 'md-', '', $icon_value ); } return '<' . $tag . ' ' . \Elementor\Utils::render_html_attributes( $attributes ) . '>'; } } new Elementor();