Created
March 19, 2018 10:41
-
-
Save swoboda/29ffd53d7fb787645978e02a11883cdf to your computer and use it in GitHub Desktop.
add-inline-js.php
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 | |
// Do NOT include the opening php tag | |
add_action( 'wp_head', 'wpdesk_custom_js' ); | |
// Add inline JS | |
function wpdesk_custom_js() { | |
echo <<<JS | |
<script type="text/javascript"> | |
// Add your JS here | |
</script> | |
JS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment