You would need to put something like this in a .php file of any name in your must-use plugins folder (/wp-content/mu-plugins/
) so that it loads before all plugins so you can use it to filter the plugin loading…
<?php
if (defined('SHORTINIT') && SHORTINIT) {
add_filter('option_active_plugins', 'shortinit_plugins_filter');
function shortinit_plugins_filter($plugins) {
$noloadplugins = array('w3-total-cache');
foreach ($plugins as $i => $plugin) {
if (in_array($plugin, $noloadplugins)) {unset($plugins[$i]);}
}
return $plugins;
}
}
Alternatively manually include whatever function files you need to make things work as they should.
UPDATE for Multisite
You would need to use a different filter on multisite, something like this should work, eg. for blog ID 2…
<?php
if (defined('SHORTINIT') && SHORTINIT) {
add_filter('site_option_active_plugins', 'shortinit_site_plugins_filter', 10, 3);
function shortinit_site_plugins_filter($plugins, $option, $network_id) {
if ($network_id == 2) {
$noloadplugins = array('w3-total-cache');
foreach ($plugins as $i => $plugin) {
if (in_array($plugin, $noloadplugins)) {unset($plugins[$i]);}
}
}
return $plugins;
}
}
Note if wanted to change sitewide activated plugins you would need to do further filtering of the network wide active plugins, something like:
<?php
if (defined('SHORTINIT') && SHORTINIT) {
add_filter('option_active_sitewide_plugins', 'shortinit_network_plugins_filter');
function shortinit_network_plugins_filter($plugins) {
if (get_current_blog() == 2) {
$noloadplugins = array('w3-total-cache');
foreach ($plugins as $i => $plugin) {
if (in_array($plugin, $noloadplugins)) {unset($plugins[$i]);}
}
}
return $plugins;
}
}