Skip to content

Instantly share code, notes, and snippets.

@spacedmonkey
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacedmonkey/c45dc6c4ede0d4b96119 to your computer and use it in GitHub Desktop.
Save spacedmonkey/c45dc6c4ede0d4b96119 to your computer and use it in GitHub Desktop.
$script_tag = "<script type='text/javascript' src='%s'></script>\n";
/**
* Filter the script tag.
*
* @since 4.1.0
*
* @param string $script_tag Script tag.
* @param string $src Source of script.
* @param string $handle Script handle.
* @param boolean $concat Is concat
*/
$script_tag = apply_filters( 'script_loader_tag', $script_tag, $src, $handle, $this->do_concat );
$script = sprintf($script_tag, $src);
if ( $this->do_concat ) {
$this->print_html .= $script;
} else {
echo $script;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment