Created
April 8, 2016 17:08
-
-
Save mattradford/f11bc4da7a06c742377307f621450cd6 to your computer and use it in GitHub Desktop.
SVG output function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check and return an SVG icon inline | |
// Adapted from https://jdsteinbach.com/wordpress/using-svgs-wordpress/ | |
// Needs SVG Support plugin as well | |
function tend_print_svg( $icon ) { | |
if ( false !== strpos( $icon, '.svg' ) ) { | |
$icon = str_replace( site_url(), '', $icon ); | |
include( ABSPATH . $icon ); | |
} | |
return $icon; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment