Skip to content

Instantly share code, notes, and snippets.

@everaldomatias
Last active February 22, 2018 12:20
Show Gist options
  • Save everaldomatias/e3f7af6eaa19037d7046c39f6c860390 to your computer and use it in GitHub Desktop.
Save everaldomatias/e3f7af6eaa19037d7046c39f6c860390 to your computer and use it in GitHub Desktop.
Função para retornar tag <span> com ícone da biblioteca Glyphicons
/**
*
* Função para retornar tag <span> com ícone da biblioteca Glyphicons
*
* @author Everaldo Matias <http://everaldomatias.github.io>
* @version 0.1
* @since 22/02/2018
* @link https://gist.github.com/everaldomatias/e3f7af6eaa19037d7046c39f6c860390
* @param $icon string que irá receber a especificação do ícone
* @example <?php echo get_glyphicon( 'glyphicon-heart' ); ?>
* @see https://getbootstrap.com/docs/3.3/components/
* @return html tag
*
*/
function get_glyphicon( $icon ) {
if ( '' != $icon ) {
return '<span class="glyphicon ' . esc_attr( $icon ) . '" aria-hidden="true"></span>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment