Loading scripts with wp_register_script and wp_enqueue_script
There are probably various ways to do this – personally I use the following for loading some small scripts only on the “new” and “edit” pages (datepicker etc.): function load_my_admin_scripts( $hook ) { if (( $hook == ‘post.php’ || $hook == ‘post-new.php’ )) { wp_enqueue_script( ‘my-datepicker’, // name / handle of the script SCRIPTS . ‘script.js’, … Read more