How do I pass the template url to javascript in the ADMIN area of my theme?
If you want to use the variables from the admin.js script, and you want to be sure it works you have to use as handle for wp_localize_script the handle of the script that have to use data call wp_localize_script after that script is enqueued wp_enqueue_script( ‘some_handle’ ); wp_enqueue_script(“admin”, $adminDir.”js/admin.js”, false, “1.0”); $translation_array = array( ‘some_string’ … Read more