@kezily Just tell to your dev (or do it yourself) to add this code in the proper file of your plugin location :
function custom_is_plugin_active( $plugin ) {
return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || custom_is_plugin_active_for_network( $plugin );
}
function custom_is_plugin_active_for_network( $plugin ) {
if ( ! is_multisite() ) {
return false;
}
$plugins = get_site_option( 'active_sitewide_plugins' );
if ( isset( $plugins[ $plugin ] ) ) {
return true;
}
return false;
}
if( !custom_is_plugin_active( WP_PLUGIN_DIR . '/cmb2/init.php' )) {
if ( file_exists( YOUR_PLUGIN_PATH . '/cmb2/init.php' ) ) {
require_once YOUR_PLUGIN_PATH . '/cmb2/init.php';
} elseif ( file_exists( YOUR_PLUGIN_PATH . '/CMB2/init.php' ) ) {
require_once YOUR_PLUGIN_PATH . '/CMB2/init.php';
}
}
This code is to adapt to the plugin itself.
A more simple solution, to wrap under conditional statement, could be done with wp_deregister_style( 'cmb2-styles' );
:
add_action( 'admin_enqueue_scripts', function () {
// If statement made by you, needed to don't break CSS of your plugin
wp_deregister_style( 'cmb2-styles' );
// endif
});
This will deregister cmb2 stylesheet load and will solve your issue.
-
This reply was modified 5 years, 9 months ago by moxymore.