Blog Archive

Pass PHP data to Javascript in WordPress using wp_localize_script

The wp_localize_script function is primarily used to allow Wordpress to translate strings into multiple languages.  It has another, more useful, ability though; it allows you to pass any data you like from your PHP scripts [...]