Created
November 26, 2012 15:02
-
-
Save claudiosanches/4148654 to your computer and use it in GitHub Desktop.
Wordpress - Script Shortcode
This file contains hidden or 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 | |
/** | |
* Embed Scripts in Wordpress editor. | |
* | |
* Usage: | |
* [js]http://youtsite.com/script.js[/js] | |
* | |
* @param array $atts | |
* @param string $content | |
* @return string | |
*/ | |
function cs_shortcode_script( $atts, $content = null ) { | |
return '<script type="text/javascript" src="' . $content . '"></script>'; | |
} | |
add_shortcode( 'js', 'cs_shortcode_script' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment