WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/02/2010 10:57:44 PM (11 years ago)
Author:
nacin
Message:

Support network-wide plugin re-activation in upgrades and edits. props PeteMall, fixes #13216

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugin-editor.php

    r14299 r14348  
    5656        fclose($f);
    5757
     58        $network_wide = is_plugin_active_for_network( $file );
     59
    5860        // Deactivate so we can test it.
    5961        if ( is_plugin_active($file) || isset($_POST['phperror']) ) {
     
    6365            update_option('recently_activated', array($file => time()) + (array)get_option('recently_activated'));
    6466
    65             wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto"));
     67            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));
    6668            exit;
    6769        }
     
    8486
    8587        if ( ! is_plugin_active($file) )
    86             activate_plugin($file, "plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error
     88            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
    8789
    8890        wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
Note: See TracChangeset for help on using the changeset viewer.