26 lines
858 B
PHP
26 lines
858 B
PHP
<?php
|
|
/**
|
|
* Comment sprite icons — <use> references into the runtime svg-icon sprite.
|
|
*
|
|
* Mirrors zib_get_svg() from the reference comments module. Symbol
|
|
* definitions are injected by assets/js/runtime/svg-icon.js, which the
|
|
* vendor runtime lazy-loads on every page (main.js: tbquire(['svg-icon'])).
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (!function_exists('aksrt_get_comment_icon')) :
|
|
/**
|
|
* Sprite-referenced SVG icon (legacy: zib_get_svg).
|
|
*
|
|
* @param string $name Sprite key (like / topping / approve / menu_2 / signup).
|
|
* @param string $class Classes for the svg element.
|
|
* @return string
|
|
*/
|
|
function aksrt_get_comment_icon(string $name, string $class = 'icon'): string {
|
|
return '<svg class="' . esc_attr($class) . '" aria-hidden="true"><use xlink:href="#icon-' . esc_attr($name) . '"></use></svg>';
|
|
}
|
|
endif;
|