I am just finishing a website, and with one feature I built as an ACF Gutenberg Block (in a plugin), I realized that it would be probably advantageous if the script sits in the header. If the script gets loaded late, it sometimes shows all videos below each other instead of just displaying them one after the other.
Now I know that, when registering a script the WP way via wp_enqueue_script, I just can change the last parameter to false and it’s in the header. So I found out, that while registering the Block, I can also use enqueue_assets instead of enqueue_script as a parameter to put the assets in an array via wp_enqueue_script. So my code looks like this – it works fine, except for it ignoring the false parameter in the end. Does anyone of you have an idea? Any help is much appreciated!