mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-23 14:54:33 +00:00
Support network-wide plugin re-activation in upgrades and edits. props PeteMall, fixes #13216
git-svn-id: https://develop.svn.wordpress.org/trunk@14348 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -55,6 +55,8 @@ case 'update':
|
||||
fwrite($f, $newcontent);
|
||||
fclose($f);
|
||||
|
||||
$network_wide = is_plugin_active_for_network( $file );
|
||||
|
||||
// Deactivate so we can test it.
|
||||
if ( is_plugin_active($file) || isset($_POST['phperror']) ) {
|
||||
if ( is_plugin_active($file) )
|
||||
@@ -62,7 +64,7 @@ case 'update':
|
||||
|
||||
update_option('recently_activated', array($file => time()) + (array)get_option('recently_activated'));
|
||||
|
||||
wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto"));
|
||||
wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide));
|
||||
exit;
|
||||
}
|
||||
wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
|
||||
@@ -83,7 +85,7 @@ default:
|
||||
wp_die( $error );
|
||||
|
||||
if ( ! is_plugin_active($file) )
|
||||
activate_plugin($file, "plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error
|
||||
activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error
|
||||
|
||||
wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user