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