Hi guys,
It’s my first time working with Sage + Bedrock
I am trying to load an additional javascript file for the admin area only.
I have create a file themes/sage/resources/assets/scripts/test.js
, which contains alert('test');
In themes/sage/app/admin.php
I’ve added the admin_enqueue_scripts
hook:
add_action('admin_enqueue_scripts', function () {
wp_enqueue_script('sage/test.js', asset_path('scripts/test.js'), null, false, true);
});
The file seems to load in the admin area in the footer as expected. However, when I inspect the file contents, it’s empty and the alert call doesn’t execute.
I’m not getting any errors in the console.
Not sure what I’ve done wrong. Some help would be much appreciated.
Thanks,
Rob