LLMS_Svg::get_icon( string $id, string $title = '', string $desc = '', string $class = '' )
Get SVG Returns svg icon from svg sprite file
Description Description
Parameters Parameters
- $id
-
(string) (Required) [svg id value]
- $title
-
(string) (Optional) [optional: title]
Default value: ''
- $desc
-
(string) (Optional) [optional: description]
Default value: ''
- $class
-
(string) (Optional) [optional: css classes]
Default value: ''
Return Return
([string]) [returns sprite html]
Source Source
File: includes/class.llms.svg.php
public static function get_icon( $id, $title = '', $desc = '', $class = '' ) { $html = ''; if ( isset( $id ) ) { $html .= '<svg class="icon ' . $class . '" role="img" aria-labelledby="title desc">'; $html .= '<title id="title">' . $title . '</title>'; $html .= '<desc id="desc">' . $desc . '</desc>'; $html .= '<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="' . LLMS_SVG_DIR . '#' . $id . '"></use>'; $html .= '</svg>'; } return $html; }
Expand full source code Collapse full source code View on GitHub