Created
May 20, 2011 12:51
-
-
Save clawfire/982827 to your computer and use it in GitHub Desktop.
Let Some JS file know some Wordpress Constant
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 | |
/** | |
* DEFINVE SOME VARIABLE FOR MY JS FILES | |
*/ | |
function environment_var(){ | |
?> | |
<script type="text/javascript"> | |
var templatePath = "<?php bloginfo('template_directory') ?>"; | |
</script> | |
<?php | |
} | |
add_action('wp_head', 'environment_var'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment