Last active
December 20, 2015 17:19
-
-
Save snoise/6167320 to your computer and use it in GitHub Desktop.
gistのwordpress簡易表示用(function.phpに記入)
ショートコード[myGist id=********]
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
<?php | |
//####################### | |
//ショートコードを作成:gist(myGist) | |
//####################### | |
function shortCode_gist($atts,$content = null ){ | |
extract( shortcode_atts( array( | |
'id' => "" ), $atts) ); | |
$script = '<script src="https://gist.github.com/%s.js"></script>'; | |
return sprintf($script,$atts['id']); | |
} | |
add_shortcode('myGist','shortCode_gist'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment