Skip to content

Instantly share code, notes, and snippets.

@Nilpo
Forked from jackreichert/gist-shortcode.php
Created November 24, 2013 09:18
Show Gist options
  • Save Nilpo/7625121 to your computer and use it in GitHub Desktop.
Save Nilpo/7625121 to your computer and use it in GitHub Desktop.
// github gist Shortcode Usage: [gist id="" file=""]
function gist_shortcode( $atts ) {
extract(shortcode_atts(array(
'id' => '',
'file' => ''
), $atts));
return '<script src="https://gist.github.com/'.$id.'.js?file='.$file.'"></script>';
}
add_shortcode('gist', 'gist_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment