Last active
December 16, 2015 01:49
-
-
Save gallib/5358224 to your computer and use it in GitHub Desktop.
A placer dans functions.php. Utilisation: [gist id="xxx"]
This file contains 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
function embed_gist( $atts ) { | |
// Attributes | |
extract( shortcode_atts( | |
array( | |
'id' => '', | |
), $atts ) | |
); | |
// Code | |
return '<script src="https://gist.github.com/' . $atts['id'] . '.js"></script>'; | |
} | |
add_shortcode( 'gist', 'embed_gist' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment