Add "Network Activate" option to Bulk Actions menu on plugins.php. See #11644, #12139

git-svn-id: https://develop.svn.wordpress.org/trunk@13155 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-02-14 14:46:38 +00:00
parent ba884951f1
commit dc7a5f121c
4 changed files with 10 additions and 6 deletions
+3 -2
View File
@@ -437,9 +437,10 @@ function deactivate_plugins( $plugins, $silent = false ) {
*
* @param string|array $plugins
* @param string $redirect Redirect to page after successful activation.
* @param bool $network_wide Whether to enable the plugin for all sites in the network.
* @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
*/
function activate_plugins($plugins, $redirect = '') {
function activate_plugins($plugins, $redirect = '', $network_wide) {
if ( !is_array($plugins) )
$plugins = array($plugins);
@@ -447,7 +448,7 @@ function activate_plugins($plugins, $redirect = '') {
foreach ( (array) $plugins as $plugin ) {
if ( !empty($redirect) )
$redirect = add_query_arg('plugin', $plugin, $redirect);
$result = activate_plugin($plugin, $redirect);
$result = activate_plugin($plugin, $redirect, $network_wide);
if ( is_wp_error($result) )
$errors[$plugin] = $result;
}