Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress Gist ShortCode
// github gist Shortcode Usage: [gist un="" id=""]
function gist_shortcode( $atts ) {
extract(shortcode_atts(array(
'un' => '',
'id' => ''
), $atts));
return '<script src="https://gist.github.com/' . $username . '/' . $id.'.js"></script>';
}
add_shortcode('gist', 'gist_shortcode');
@jackreichert

This comment has been minimized.

Copy link
Owner Author

jackreichert commented Nov 5, 2014

The gist creates the proper embed code, but the script on github's end doesn't seem to be working anymore. I'll update if it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.