How to include php-generated javascript?
You can either not use wp_enqueue_script (which loads a JS file, where you won’t be able to use PHP) and instead simply print the script out on the wp_head or wp_footer hooks…. or you can use wp_localize_script() wp_enqueue_script( ‘some_handle’ ); $instance = // not sure how you are fetching this value $array = array( ‘thumbs’ … Read more