Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should the configuration be injected differently? #33

Open
pkra opened this issue May 22, 2023 · 2 comments
Open

should the configuration be injected differently? #33

pkra opened this issue May 22, 2023 · 2 comments

Comments

@pkra
Copy link
Member

pkra commented May 22, 2023

Responding to https://wordpress.org/support/topic/problem-with-inline-equations/

made me look at

add_action('wp_head','SimpleMathJax::configure_mathjax',1);
add_action('wp_enqueue_scripts', 'SimpleMathJax::add_mathjax');

and this got me wondering if perhaps the configuration should also hook into wp_enqueue_scripts rather than wp_head.

cc @christianp @scoskey.

@christianp
Copy link
Collaborator

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.

@pkra
Copy link
Member Author

pkra commented May 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants