I am trying to enqueuer a script after registering it but I am getting an error.
This is the script:
function _test() {
console.log("Test");
}
That's the PHP:
function fsg_shortURL() {
echo "Funtion Called";
wp_register_script('_test','/wp-content/themes/theme-child/js/test.js');
wp_enqueue_script('_test');
}
add_shortcode( 'fsg', 'fsg_shortURL' );
The console's suppouse to log Test
but nothing happens..
Thanks!