Do not load the autoptimize admin script when adminbar not showing
-
Hello, maybe the plugin author must be add this code.
adding code to classes/autoptimizeToolbar.php
// Autoptimize Toolbar Styles
if ( is_admin_bar_showing() ) {
wp_enqueue_style( ‘autoptimize-toolbar’, plugins_url(‘/static/toolbar.css’, __FILE__ ), array(), time(), “all” );
}// Autoptimize Toolbar Javascript
if ( is_admin_bar_showing() ) {
wp_enqueue_script( ‘autoptimize-toolbar’, plugins_url( ‘/static/toolbar.js’, __FILE__ ), array(‘jquery’), time(), true );
}and maybe this plugin support for adding SRI on script.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Do not load the autoptimize admin script when adminbar not showing’ is closed to new replies.