wp-73k/custom-functions.php

12 lines
No EOL
391 B
PHP

<?php
/**
* Function to support inline SVG icons by name with div wrapper
*/
function svg_icon_use($icon_name, $div_class) {
$output = "<div class=\"$div_class $icon_name\"><svg class=\"$icon_name\" aria-hidden=\"true\">";
$output .= "<use xlink:href=\"" . get_stylesheet_directory_uri() . "/dist/images/icon-sprites.svg#$icon_name\"></use>";
return $output . "</svg></div>";
};
?>