Active plugins filtering for site wide plugin support
|Reported by:||apeatling||Owned by:||westi|
This ticket contains the core changes needed for more robust support for site wide level plugin activation in WordPress MU.
The ticket this relates to is here:
By filtering the active_plugins array, we can inject site wide activated plugins into all blogs at include time. This will also allow for site wide plugins to correctly run though activate_ and deactivate_ hooks. This is important to allow the plugin manager to correctly handle site wide plugins on first install or upgrade.
There needs to be a change to the deactivate_plugins() function to accommodate for the fact that site wide plugins will not exist in the $current plugins array.
array_search() will return a value that is interpreted by array_splice() as 0 (zero) when a plugin is not found. This will then perform an incorrect splice on the $current array and cause many problems. By performing an identical check on the array_search() result we can ensure that this doesn't happen.
Patch attached for review and testing.