Skip to content

Instantly share code, notes, and snippets.

@slushman
Last active July 26, 2018 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slushman/4c1295adc18a98678b05 to your computer and use it in GitHub Desktop.
Save slushman/4c1295adc18a98678b05 to your computer and use it in GitHub Desktop.
Sane Inline SVG
/**
* Returns the requested SVG icon.
*
* Returns FALSE if $svg is not set.
*
* @param string $svg The name of the SVG icon
* @return mixed The SVG icon
*/
function prefix_get_svg( $svg ) {
if ( empty( $svg ) ) { return FALSE; }
$icons['logo'] = '<svg... SVG stuff here..."/></svg>';
return $icons[ $svg ];
} // get_svg()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment