WidgetOptions / widget-options

Additional Widget options for better widget control. Available on
https://widget-options.com/
GNU General Public License v3.0
35 stars 16 forks source link

Plugin loads custom css in admin on pages unrelated to plugin #71

Open littlebee88 opened 4 years ago

littlebee88 commented 4 years ago

I am working on a commercial site, and your plugin functionality is great; but unfortunately it is interfering with other plugins in the admin.

This block essentially loads your plugins custom styles on all but a couple admin pages:

if( !in_array( $hook, apply_filters( 'widgetopts_exclude_jqueryui', array( 'toplevel_page_et_divi_options', 'toplevel_page_wpcf7', 'edit.php' ) ) ) ){ wp_enqueue_style( 'widgetopts-jquery-ui', $css_dir . 'jqueryui/1.11.4/themes/ui-lightness/jquery-ui.css' , array(), null ); wp_enqueue_style( 'jquery-ui' ); }

You should be loading your plugins scripts and styles only on your plugins pages, you can use the $hook_suffix global and an if block to accomplish this.