Best Practice for Including JS (with PHP) in WordPress Functions file
问题 I'm building a custom WordPress theme and have a quick question regarding WordPress and the Functions.php I've got 500 lines of jQuery that run for a portion of my custom theme admin panel. The jQuery code is located inside of my functions.php file, called when the custom admin menu page is displayed. Ideally, I would like to move the JavaScript out of the functions.php file and use wp_register_script + wp_enqueue_script, but I also have some php code mixed in with the script. See below: /