For instance, my theme would be:
<?php get header(); ?> <div> <?php myFuncion("foo"); ?> </div> <manyotherdivs> ... </manyotherdivs> <aside> <?php myFunction("bar"); ?> </aside> .... and so on
Then I would like to generate this JS:
<script> var params = ["foo", "bar", "baz", ...]; </script>
I can collect the parameters by using a class and a static property, but it seems that they will be ignored in the
wp_header hook, returning an empty array.