Created
December 19, 2017 09:10
-
-
Save JulioPotier/29e86b9aeee62c5b0151ed104dfec496 to your computer and use it in GitHub Desktop.
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 | |
add_shortcode( 'script_foo', 'sc_script_foo_cb' ); | |
function sc_script_foo_cb( $atts, $content ) { | |
echo '<script type="text/javascript" src="https://example.com/foo.js" />'; | |
} | |
/* | |
Puis dans votre contenu utilisez simplement [script_foo] (le premier paramètre de 'add_shortcode') | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment