Add JS in footer via shortcode?
I’ll address your address and thruthfully you should probably be enqueuing this, and consider using wp_add_inline_script() or wp_localize_script(). However, if you can’t be bothered to do that for some reason, you can just remove the return of your shortcode, and instead use add_action(‘wp_footer’, ‘…’);. This is actually similar to how I enqueue registered scripts/styles only … Read more