Make WordPress Core


Ignore:
Timestamp:
10/02/2014 03:55:51 PM (10 years ago)
Author:
wonderboymusic
Message:

In activate_plugin(), do not re-run the activation routine for already-active network-wide plugins.

Adds unit test.

Props jbrinley.
Fixes #28651.

File:
1 edited

Legend:

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

    r29789 r29818  
    534534        return $valid;
    535535
    536     if ( !in_array($plugin, $current) ) {
     536    if ( ( $network_wide && ! isset( $current[ $plugin ] ) ) || ( ! $network_wide && ! in_array( $plugin, $current ) ) ) {
    537537        if ( !empty($redirect) )
    538538            wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
Note: See TracChangeset for help on using the changeset viewer.