- Timestamp:
- 04/03/2014 03:58:30 AM (11 years ago)
- Location:
- branches/3.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
-
branches/3.8/src/wp-admin/includes/class-wp-upgrader.php
r26851 r27923 1872 1872 return false; 1873 1873 1874 $upgrader_item = $item; 1874 1875 switch ( $type ) { 1875 1876 case 'core': … … 1878 1879 break; 1879 1880 case 'theme': 1880 $theme = wp_get_theme( $item ); 1881 $upgrader_item = $item->theme; 1882 $theme = wp_get_theme( $upgrader_item ); 1881 1883 $item_name = $theme->Get( 'Name' ); 1882 1884 $skin->feedback( __( 'Updating theme: %s' ), $item_name ); 1883 1885 break; 1884 1886 case 'plugin': 1885 $plugin_data = get_plugin_data( $context . '/' . $item ); 1887 $upgrader_item = $item->plugin; 1888 $plugin_data = get_plugin_data( $context . '/' . $upgrader_item ); 1886 1889 $item_name = $plugin_data['Name']; 1887 1890 $skin->feedback( __( 'Updating plugin: %s' ), $item_name ); … … 1895 1898 1896 1899 // Boom, This sites about to get a whole new splash of paint! 1897 $upgrade_result = $upgrader->upgrade( $ item, array(1900 $upgrade_result = $upgrader->upgrade( $upgrader_item, array( 1898 1901 'clear_update_cache' => false, 1899 1902 'pre_check_md5' => false, /* always use partial builds if possible for core updates */ … … 1969 1972 $plugin_updates = get_site_transient( 'update_plugins' ); 1970 1973 if ( $plugin_updates && !empty( $plugin_updates->response ) ) { 1971 foreach ( array_keys( $plugin_updates->response )as $plugin ) {1974 foreach ( $plugin_updates->response as $plugin ) { 1972 1975 $this->update( 'plugin', $plugin ); 1973 1976 } … … 1980 1983 $theme_updates = get_site_transient( 'update_themes' ); 1981 1984 if ( $theme_updates && !empty( $theme_updates->response ) ) { 1982 foreach ( array_keys( $theme_updates->response )as $theme ) {1983 $this->update( 'theme', $theme );1985 foreach ( $theme_updates->response as $theme ) { 1986 $this->update( 'theme', (object) $theme ); 1984 1987 } 1985 1988 // Force refresh of theme update information … … 1996 1999 // Clean up, and check for any pending translations 1997 2000 // (Core_Upgrader checks for core updates) 1998 wp_update_themes(); // Check for Theme updates 1999 wp_update_plugins(); // Check for Plugin 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 2000 2016 2001 2017 // Finally, Process any new translations
Note: See TracChangeset
for help on using the changeset viewer.