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.
Parameters Parameters
- $url
-
(string) (Required) The URL of the anchor tag.
- $args
-
(array) (Optional) An array of optional configuration options.<br>
- 'size'
(integer) The size of the icon. Default 18.<br> - 'title'
(string) The title attribute of the anchor tag. Default: "More information".<br> - 'icon'
(string) The Dashicon icon to use, @link <a href="https://developer.wordpress.org/resource/dashicons/">https://developer.wordpress.org/resource/dashicons/</a>. Default: "external".<br>
Default value: array()
- 'size'
Return Return
(string)
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
);
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |