Created
October 29, 2015 07:56
-
-
Save ville6000/86c5ad310d7e26398a72 to your computer and use it in GitHub Desktop.
Add localized JavaScript variables to WordPress theme
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 | |
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); | |
function my_theme_enqueue_styles() { | |
wp_localize_script( | |
'script', | |
'i18n', | |
array( | |
'download' => __( 'Download file', 'mytheme' ), | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment