New answers tagged

1

Here is the final code I now use to add type="module" to my scripts. wp_register_script('my-script', get_theme_file_uri('/js/script.js'), ['axios'], '1.0'); wp_enqueue_script('my-script'); add_filter("script_loader_tag", "add_module_to_my_script", 10, 3); function add_module_to_my_script($tag, $handle, $src) { if ("my-...


Top 50 recent answers are included