Splitleaf/easy-mailchimp-integration — Issue #24: Plugin Causes Conflict with Other WP Admin Pages
Author: pagesimplify
Created: 2012-02-12 10:24:53+00:00
State: open

The EMI CSS / JS files are loading on every WP Admin page causing conflicts with other pages. Please review my patch notes and apply to the code. I'm working from a computer where I can submit the changes myself to the source code.

File to Edit:
/easy-mailchimp-integration/classes/class.emiBase.php

Replace the current code:

// Add the CSS/JS files
add_action('admin_print_styles',	array(&$this, 'addStyles'));
add_action('admin_print_scripts',	array(&$this, 'addScripts'));
if(!is_admin())
{
add_action('wp_print_styles', array(&$this, 'addStyles_frontend'));
add_action('wp_print_scripts', array(&$this, 'addScripts_frontend'));
}

WIth this modified code:

if(is_admin() && false !== strpos($_REQUEST['page'], 'emi-mailchimp')){
add_action('admin_print_styles',	array(&$this, 'addStyles'));
add_action('admin_print_scripts',	array(&$this, 'addScripts'));
} else {
add_action('wp_print_styles', array(&$this, 'addStyles_frontend'));
add_action('wp_print_scripts', array(&$this, 'addScripts_frontend'));
}

This fix will limit loading EMI JS / CSS files to the EMI specific Admin Screens.

Best Regards,

David Carroll