WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r27923 r26851  
    18721872            return false;
    18731873
    1874         $upgrader_item = $item;
    18751874        switch ( $type ) {
    18761875            case 'core':
     
    18791878                break;
    18801879            case 'theme':
    1881                 $upgrader_item = $item->theme;
    1882                 $theme = wp_get_theme( $upgrader_item );
     1880                $theme = wp_get_theme( $item );
    18831881                $item_name = $theme->Get( 'Name' );
    18841882                $skin->feedback( __( 'Updating theme: %s' ), $item_name );
    18851883                break;
    18861884            case 'plugin':
    1887                 $upgrader_item = $item->plugin;
    1888                 $plugin_data = get_plugin_data( $context . '/' . $upgrader_item );
     1885                $plugin_data = get_plugin_data( $context . '/' . $item );
    18891886                $item_name = $plugin_data['Name'];
    18901887                $skin->feedback( __( 'Updating plugin: %s' ), $item_name );
     
    18981895
    18991896        // Boom, This sites about to get a whole new splash of paint!
    1900         $upgrade_result = $upgrader->upgrade( $upgrader_item, array(
     1897        $upgrade_result = $upgrader->upgrade( $item, array(
    19011898            'clear_update_cache' => false,
    19021899            'pre_check_md5'      => false, /* always use partial builds if possible for core updates */
     
    19721969        $plugin_updates = get_site_transient( 'update_plugins' );
    19731970        if ( $plugin_updates && !empty( $plugin_updates->response ) ) {
    1974             foreach ( $plugin_updates->response as $plugin ) {
     1971            foreach ( array_keys( $plugin_updates->response ) as $plugin ) {
    19751972                $this->update( 'plugin', $plugin );
    19761973            }
     
    19831980        $theme_updates = get_site_transient( 'update_themes' );
    19841981        if ( $theme_updates && !empty( $theme_updates->response ) ) {
    1985             foreach ( $theme_updates->response as $theme ) {
    1986                 $this->update( 'theme', (object) $theme );
     1982            foreach ( array_keys( $theme_updates->response ) as $theme ) {
     1983                $this->update( 'theme', $theme );
    19871984            }
    19881985            // Force refresh of theme update information
     
    19991996        // Clean up, and check for any pending translations
    20001997        // (Core_Upgrader checks for core updates)
    2001         $theme_stats = array();
    2002         if ( isset( $this->update_results['theme'] ) ) {
    2003             foreach ( $this->update_results['theme'] as $upgrade ) {
    2004                 $theme_stats[ $upgrade->item->theme ] = ( true === $upgrade->result );
    2005             }
    2006         }
    2007         wp_update_themes( $theme_stats );  // Check for Theme updates
    2008 
    2009         $plugin_stats = array();
    2010         if ( isset( $this->update_results['plugin'] ) ) {
    2011             foreach ( $this->update_results['plugin'] as $upgrade ) {
    2012                 $plugin_stats[ $upgrade->item->plugin ] = ( true === $upgrade->result );
    2013             }
    2014         }
    2015         wp_update_plugins( $plugin_stats ); // Check for Plugin updates
     1998        wp_update_themes();  // Check for Theme updates
     1999        wp_update_plugins(); // Check for Plugin updates
    20162000
    20172001        // Finally, Process any new translations
Note: See TracChangeset for help on using the changeset viewer.