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: ''


Top ↑

Return Return

([string]) [returns sprite html]


Top ↑

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;

	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.