'; } if ($glyph === '') { return; } $view = in_array($settings['view'] ?? 'default', ['default', 'stacked', 'framed'], true) ? $settings['view'] : 'default'; $shape = ($settings['shape'] ?? 'circle') === 'square' ? 'square' : 'circle'; $classes = ''; if ($view !== 'default') { $classes = 'zx-icon--' . $view . ' zx-icon--' . $shape . ' '; $attrs = preg_replace('/class="/', 'class="' . esc_attr($classes), $attrs, 1); } $zx_link = is_array($settings['link'] ?? null) ? $settings['link'] : []; $href = isset($zx_link['url']) && is_string($zx_link['url']) ? $zx_link['url'] : ''; if ($href !== '') { $rel = []; if (!empty($zx_link['nofollow'])) { $rel[] = 'nofollow'; } if (($zx_link['target'] ?? '') === '_blank') { $rel[] = 'noopener'; } $wrap = '' . $glyph . ''; } else { $wrap = '' . $glyph . ''; } $zx_html = '
' . $wrap . '
'; echo wp_kses($zx_html, \Zadex\Frontend\Kses::allowed_html()) . "\n";