Open pkra opened 1 year ago
wp_enqueue_scripts
doesn't happen at the point that the script tags are produced, it's just used to set up the queue of script URLs that should be used. Since the configuration script is defined inside the script tag instead of being loaded from a URL, we can't set it up there.
Thanks, @christianp. My wordpress knowledge has degraded significantly in the past few years.
If anyone knows of a better way to handle the injection of the configuration, please leave a comment.
Responding to https://wordpress.org/support/topic/problem-with-inline-equations/
made me look at
https://github.com/boolesrings/Simple-Mathjax-wordpress-plugin/blob/7bf526c723ed2904c97a99281fe4b2f8428d65aa/simple-mathjax.php#L357-L358
and this got me wondering if perhaps the configuration should also hook into
wp_enqueue_scripts
rather thanwp_head
.cc @christianp @scoskey.