Advanced Tagline causes "advtag.js" to load in public pages
-
The Advanced Tagline plugin’s code enqueues its “advtag.js” script without taking any steps to limit where the script is loaded. This causes the script to be included in the header of every page (public and admin).
I’ve never written or edited a plugin before, so a 100% fix (making the script only load on the Advanced Tagline settings page) will take me a bit longer, but I at least got the script to only load in admin pages (and in the page footer, not the <head>) with the following code changes:
add_action('init', 'advtag_scripts');
to:
add_action('admin_init', 'advtag_scripts');
and:
wp_enqueue_script('advtag', $path.'advtag.js', array('jquery'), '1.0' );
to:
wp_enqueue_script('advtag', $path.'advtag.js', array('jquery'), '1.0', true );
- The topic ‘Advanced Tagline causes "advtag.js" to load in public pages’ is closed to new replies.