I've suddenly had an issue that neither admin_enqueue_scripts or wp_register_script are working properly, they were working fine for a while but suddenly stopped working.
In the following function, the first wp_register_script is working fine and loading modernizr, and the wp_enqueue_style is working fine and loading globalstyle, but neither the require or the global scripts are loading.
function theme_enqueue_scripts(){
wp_register_script('modernizr', get_stylesheet_directory_uri() . '/js/modernizr.js');
wp_register_script('require', get_stylesheet_directory_uri() . '/js/vendor/requirejs/require.js', array(), false, true);
wp_register_script('global', get_stylesheet_directory_uri() . '/js/global.js', array('require'), false, true);
wp_enqueue_style('globalstyle', get_stylesheet_directory_uri() . '/css/global.css');
}
add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
And the following function doesn't load admin-nav.js using admin_enqueue_scripts()
function navigation_script() {
wp_register_script('admin-nav', get_stylesheet_directory_uri() . '/js/admin-nav.js',array(), null, true);
}
add_action( 'admin_enqueue_scripts', 'navigation_script' );