llms_get_dashicon_link( string $url, array $args = array() )

Retrieves HTML for a Dashicon wrapped in an anchor.


Description Description

A utility for adding links to external documentation.


Top ↑

Parameters Parameters

$url

(string) (Required) The URL of the anchor tag.

$args

(array) (Optional) An array of optional configuration options.

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/admin/llms.functions.admin.php

function llms_get_dashicon_link( $url, $args = array() ) {

	$args = wp_parse_args(
		$args,
		array(
			'size'  => 18,
			'title' => esc_attr__( 'More information', 'lifterlms' ),
			'icon'  => 'external',
		)
	);

	$dashicon = sprintf(
		'<span class="dashicons dashicons-%1$s" style="font-size:%2$dpx;width:%2$dpx;height:%2$dpx"></span>',
		esc_attr( $args['icon'] ),
		$args['size']
	);

	return sprintf(
		'<a href="%1$s" style="text-decoration:none;" target="_blank" rel="noreferrer" title="%2$s">%3$s</a>',
		esc_url( $url ),
		esc_attr( $args['title'] ),
		$dashicon
	);

}

Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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