WordPress.org

Make WordPress Core

Changeset 15469


Ignore:
Timestamp:
07/24/2010 03:59:53 AM (8 years ago)
Author:
dd32
Message:
Only use maintenance_mode() for ( is_multisite()
(plugin|theme) being updated is in use ) with Plugin|Theme Bulk Upgrades. See #14393
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r15301 r15469  
    469469        $this->skin->bulk_header();
    470470
    471         $this->maintenance_mode(true);
     471        // Only start maintenance mode if running in Multisite OR the plugin is in use
     472        $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
     473        foreach ( $plugins as $plugin )
     474            $maintenance = $maintenance || (is_plugin_active($plugin) && isset($current->response[ $plugin ]) ); // Only activate Maintenance mode if a plugin is active AND has an update available
     475        if ( $maintenance )
     476            $this->maintenance_mode(true);
    472477
    473478        $results = array();
     
    713718        $this->skin->bulk_header();
    714719
    715         $this->maintenance_mode(true);
     720        // Only start maintenance mode if running in Multisite OR the theme is in use
     721        $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
     722        foreach ( $themes as $theme )
     723            $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
     724        if ( $maintenance )
     725            $this->maintenance_mode(true);
    716726
    717727        $results = array();
     
    781791        if ( $theme != get_stylesheet() ) //If not current
    782792            return $return;
    783         //Change to maintainence mode now.
     793        //Change to maintenance mode now.
    784794        if ( ! $this->bulk )
    785795            $this->maintenance_mode(true);
     
    797807
    798808        //Ensure stylesheet name hasnt changed after the upgrade:
     809        // @TODO: Note, This doesnt handle the Template changing, or the Template name changing.
    799810        if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
    800811            $theme_info = $this->theme_info();
     
    804815        }
    805816
    806         //Time to remove maintainence mode
     817        //Time to remove maintenance mode
    807818        if ( ! $this->bulk )
    808819            $this->maintenance_mode(false);
Note: See TracChangeset for help on using the changeset viewer.