Last active
July 13, 2016 20:58
-
-
Save webarthur/00e88ad36bd0c530caa739b270204e05 to your computer and use it in GitHub Desktop.
Shortcode para inserir scripts externos na edição do post WordPress
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 | |
function register_shortcode_script() { | |
add_shortcode('script', function($src) { | |
extract(shortcode_atts(array( | |
'src' => 'src' | |
), $src)); | |
return "<script src=\"$src\"></script>"; | |
}); | |
} | |
add_action( 'init', 'register_shortcode_script'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment