Is it possible to do with Array? I have several Scripts that I want to do this, can I just replicate this code by changing the scripts? An Array would be better, right?
You can also use the $handle argument to filter scripts.
To expand on Geoffrey Brossard’s note, you might run into issues deferring all, the example below you can exclude the handles you might need from this filter like so:
Useful when a script excecution depends on “ attributes, eg:
Scripts must be registered/enqueued via wp_enqueue_script()It can be used to defer or async all JS scripts :
You can also use the
$handleargument to filter scripts.