Closed kkmuffme closed 3 years ago
My problem is that https://developer.wordpress.org/reference/functions/wp_localize_script/ doesn't have a dependency option, so I always get Sentry not defined error bc the sentry init didn't run at the point I am localizing the script (even when in footer)
Yeah you shouldn't use wp_localize_script
because that always runs before the actual script.
You can use wp_add_inline_script
or possibly a JS file using wp_enqueue_script
.
They both have dependency options. Would that work for you?
This doesn't seem needed... you can place your script right after the one from Sentry and call
Sentry.addGlobalEventProcessor
there. No need for changes to the plugin :)