Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Very simple shortcode to easily add gists in WordPress using the url for reference. All it does is wrap the specified url with the script tags needed.
// [gist url=""]
function gist_function( $atts ) {
$a = shortcode_atts( array(
'url' => ''
), $atts );
return '<script src="' . esc_attr($a['url']) . '.js"></script>';
add_shortcode( 'gist', 'gist_function' );
Copy link

bappi-d-great commented Jul 30, 2014

Cool :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment