Changeset 12673
- Timestamp:
- 01/08/2010 08:49:55 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r12533 r12673 399 399 400 400 // Force refresh of plugin update information 401 delete_ transient('update_plugins');401 delete_site_transient('update_plugins'); 402 402 403 403 } … … 408 408 $this->upgrade_strings(); 409 409 410 $current = get_ transient( 'update_plugins' );410 $current = get_site_transient( 'update_plugins' ); 411 411 if ( !isset( $current->response[ $plugin ] ) ) { 412 412 $this->skin->set_result(false); … … 441 441 442 442 // Force refresh of plugin update information 443 delete_ transient('update_plugins');443 delete_site_transient('update_plugins'); 444 444 } 445 445 … … 450 450 $this->upgrade_strings(); 451 451 452 $current = get_ transient( 'update_plugins' );452 $current = get_site_transient( 'update_plugins' ); 453 453 454 454 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); … … 509 509 510 510 // Force refresh of plugin update information 511 delete_ transient('update_plugins');511 delete_site_transient('update_plugins'); 512 512 513 513 return $results; … … 628 628 629 629 // Force refresh of theme update information 630 delete_ transient('update_themes');630 delete_site_transient('update_themes'); 631 631 632 632 if ( empty($result['destination_name']) ) … … 642 642 643 643 // Is an update available? 644 $current = get_ transient( 'update_themes' );644 $current = get_site_transient( 'update_themes' ); 645 645 if ( !isset( $current->response[ $theme ] ) ) { 646 646 $this->skin->set_result(false); … … 672 672 673 673 // Force refresh of theme update information 674 delete_ transient('update_themes');674 delete_site_transient('update_themes'); 675 675 676 676 return true; -
trunk/wp-admin/includes/plugin-install.php
r11585 r12673 444 444 $type = 'install'; 445 445 //Check to see if this plugin is known to be installed, and has an update awaiting it. 446 $update_plugins = get_ transient('update_plugins');446 $update_plugins = get_site_transient('update_plugins'); 447 447 if ( is_object( $update_plugins ) ) { 448 448 foreach ( (array)$update_plugins->response as $file => $plugin ) { … … 465 465 } else { 466 466 //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh 467 delete_ transient('update_plugins');467 delete_site_transient('update_plugins'); 468 468 $update_file = $api->slug . '/' . $key; //This code branch only deals with a plugin which is in a folder the same name as its slug, Doesnt support plugins which have 'non-standard' names 469 469 $type = 'update_available'; -
trunk/wp-admin/includes/plugin.php
r12636 r12673 468 468 469 469 // Force refresh of plugin update information 470 if ( $current = get_ transient('update_plugins') ) {470 if ( $current = get_site_transient('update_plugins') ) { 471 471 unset( $current->response[ $plugin_file ] ); 472 set_ transient('update_plugins', $current);472 set_site_transient('update_plugins', $current); 473 473 } 474 474 -
trunk/wp-admin/includes/theme-install.php
r11497 r12673 477 477 $type = 'install'; 478 478 // Check to see if this theme is known to be installed, and has an update awaiting it. 479 $update_themes = get_ transient('update_themes');479 $update_themes = get_site_transient('update_themes'); 480 480 if ( is_object($update_themes) && isset($update_themes->response) ) { 481 481 foreach ( (array)$update_themes->response as $theme_slug => $theme_info ) { -
trunk/wp-admin/includes/theme.php
r12253 r12673 98 98 99 99 // Force refresh of theme update information 100 delete_ transient('update_themes');100 delete_site_transient('update_themes'); 101 101 102 102 return true; -
trunk/wp-admin/includes/update-core.php
r12564 r12673 279 279 280 280 // Force refresh of update information 281 if ( function_exists('delete_ transient') )282 delete_ transient('update_core');281 if ( function_exists('delete_site_transient') ) 282 delete_site_transient('update_core'); 283 283 else 284 284 delete_option('update_core'); -
trunk/wp-admin/includes/update.php
r12066 r12673 32 32 function get_core_updates( $options = array() ) { 33 33 $options = array_merge( array('available' => true, 'dismissed' => false ), $options ); 34 $dismissed = get_ option( 'dismissed_update_core' );34 $dismissed = get_site_option( 'dismissed_update_core' ); 35 35 if ( !is_array( $dismissed ) ) $dismissed = array(); 36 $from_api = get_ transient( 'update_core' );36 $from_api = get_site_transient( 'update_core' ); 37 37 if ( empty($from_api) ) 38 38 return false; … … 58 58 59 59 function dismiss_core_update( $update ) { 60 $dismissed = get_ option( 'dismissed_update_core' );60 $dismissed = get_site_option( 'dismissed_update_core' ); 61 61 $dismissed[ $update->current.'|'.$update->locale ] = true; 62 return update_ option( 'dismissed_update_core', $dismissed );62 return update_site_option( 'dismissed_update_core', $dismissed ); 63 63 } 64 64 65 65 function undismiss_core_update( $version, $locale ) { 66 $dismissed = get_ option( 'dismissed_update_core' );66 $dismissed = get_site_option( 'dismissed_update_core' ); 67 67 $key = $version.'|'.$locale; 68 68 if ( !isset( $dismissed[$key] ) ) return false; 69 69 unset( $dismissed[$key] ); 70 return update_ option( 'dismissed_update_core', $dismissed );70 return update_site_option( 'dismissed_update_core', $dismissed ); 71 71 } 72 72 73 73 function find_core_update( $version, $locale ) { 74 $from_api = get_ transient( 'update_core' );74 $from_api = get_site_transient( 'update_core' ); 75 75 if ( !is_array( $from_api->updates ) ) return false; 76 76 $updates = $from_api->updates; … … 149 149 $all_plugins = get_plugins(); 150 150 $upgrade_plugins = array(); 151 $current = get_ transient( 'update_plugins' );151 $current = get_site_transient( 'update_plugins' ); 152 152 foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { 153 153 if ( isset( $current->response[ $plugin_file ] ) ) { … … 161 161 162 162 function wp_plugin_update_rows() { 163 $plugins = get_ transient( 'update_plugins' );163 $plugins = get_site_transient( 'update_plugins' ); 164 164 if ( isset($plugins->response) && is_array($plugins->response) ) { 165 165 $plugins = array_keys( $plugins->response ); … … 172 172 173 173 function wp_plugin_update_row( $file, $plugin_data ) { 174 $current = get_ transient( 'update_plugins' );174 $current = get_site_transient( 'update_plugins' ); 175 175 if ( !isset( $current->response[ $file ] ) ) 176 176 return false; … … 208 208 function get_theme_updates() { 209 209 $themes = get_themes(); 210 $current = get_ transient('update_themes');210 $current = get_site_transient('update_themes'); 211 211 $update_themes = array(); 212 212 -
trunk/wp-admin/menu.php
r12629 r12673 105 105 $submenu['themes.php'][15] = array(__('Add New Themes'), 'install_themes', 'theme-install.php'); 106 106 107 $update_plugins = get_ transient( 'update_plugins' );107 $update_plugins = get_site_transient( 'update_plugins' ); 108 108 $update_count = 0; 109 109 if ( !empty($update_plugins->response) ) -
trunk/wp-admin/plugins.php
r12636 r12673 303 303 if ( $recently_activated != get_option('recently_activated') ) //If array changed, update it. 304 304 update_option('recently_activated', $recently_activated); 305 $current = get_ transient( 'update_plugins' );305 $current = get_site_transient( 'update_plugins' ); 306 306 307 307 foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { -
trunk/wp-admin/themes.php
r12546 r12673 99 99 static $themes_update; 100 100 if ( !isset($themes_update) ) 101 $themes_update = get_ transient('update_themes');101 $themes_update = get_site_transient('update_themes'); 102 102 103 103 if ( is_object($theme) && isset($theme->stylesheet) ) -
trunk/wp-admin/upgrade.php
r12577 r12673 21 21 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 22 22 23 delete_ transient('update_core');23 delete_site_transient('update_core'); 24 24 25 25 if ( isset( $_GET['step'] ) ) -
trunk/wp-includes/ms-functions.php
r12672 r12673 2089 2089 } 2090 2090 2091 /* Short circuit the update checks. Make sure update informtion is2092 stored in wp_sitemeta rather than the options table of individual blogs */2093 2094 // update_plugins (transient)2095 function site_delete_update_plugins() {2096 return update_site_option( 'update_plugins', false );2097 }2098 add_action( 'delete_transient_update_plugins', 'site_delete_update_plugins' );2099 2100 function site_pre_update_plugins() {2101 return get_site_option( 'update_plugins' );2102 }2103 add_filter( 'pre_transient_update_plugins', 'site_pre_update_plugins' );2104 2105 function site_pre_set_transient_update_plugins( $value ) {2106 update_site_option( 'update_plugins', $value );2107 return $value;2108 }2109 add_filter( 'pre_set_transient_update_plugins', 'site_pre_set_transient_update_plugins' );2110 2111 add_action( 'add_option__transient_update_plugins', 'site_add_option__transient_update');2112 2113 // update_themes (transient)2114 function site_delete_update_themes() {2115 return update_site_option( 'update_themes', false );2116 }2117 add_action( 'delete_transient_update_themes', 'site_delete_update_themes' );2118 2119 function site_pre_update_themes() {2120 return get_site_option( 'update_themes' );2121 }2122 add_filter( 'pre_transient_update_themes', 'site_pre_update_themes' );2123 2124 function site_pre_set_transient_update_themes( $value ) {2125 update_site_option( 'update_themes', $value );2126 return $value;2127 }2128 add_filter( 'pre_set_transient_update_themes', 'site_pre_set_transient_update_themes' );2129 2130 add_action( 'add_option__transient_update_themes', 'site_add_option__transient_update');2131 2132 // update_core (transient)2133 function site_delete_update_core() {2134 return update_site_option( 'update_core', false );2135 }2136 add_action( 'delete_transient_update_core', 'site_delete_update_core' );2137 2138 function site_pre_update_core() {2139 return get_site_option( 'update_core' );2140 }2141 add_filter( 'pre_transient_update_core', 'site_pre_update_core' );2142 2143 function site_pre_set_transient_update_core( $value ) {2144 update_site_option( 'update_core', $value );2145 return $value;2146 }2147 add_filter( 'pre_set_transient_update_core', 'site_pre_set_transient_update_core' );2148 2149 add_action( 'add_option__transient_update_core', 'site_add_option__transient_update');2150 2151 // dismissed_update_core (option, not a transient)2152 function site_pre_dismissed_update_core() {2153 return get_site_option( 'dismissed_update_core' );2154 }2155 add_filter( 'pre_option_dismissed_update_core', 'site_pre_dismissed_update_core' );2156 2157 function site_pre_update_option_dismissed_update_core( $newvalue, $oldvalue ) {2158 update_site_option( 'dismissed_update_core', $newvalue );2159 delete_option('dismissed_update_core');2160 // Return the old value so the update_option() call is aborted after this filter is run. It's in sitemeta now.2161 return $oldvalue;2162 }2163 add_filter( 'pre_update_option_dismissed_update_core', 'site_pre_update_option_dismissed_update_core', 10, 2 );2164 2165 2166 2167 function site_add_option__transient_update($name) {2168 delete_option($name);2169 }2170 2171 2091 /* Redirect all hits to "dashboard" blog to wp-admin/ Dashboard. */ 2172 2092 function redirect_mu_dashboard() { -
trunk/wp-includes/update.php
r12523 r12673 27 27 $php_version = phpversion(); 28 28 29 $current = get_ transient( 'update_core' );29 $current = get_site_transient( 'update_core' ); 30 30 if ( ! is_object($current) ) { 31 31 $current = new stdClass; … … 38 38 // Update last_checked for current to prevent multiple blocking requests if request hangs 39 39 $current->last_checked = time(); 40 set_ transient( 'update_core', $current );40 set_site_transient( 'update_core', $current ); 41 41 42 42 if ( method_exists( $wpdb, 'db_version' ) ) … … 86 86 $updates->last_checked = time(); 87 87 $updates->version_checked = $wp_version; 88 set_ transient( 'update_core', $updates);88 set_site_transient( 'update_core', $updates); 89 89 } 90 90 … … 114 114 $plugins = get_plugins(); 115 115 $active = get_option( 'active_plugins' ); 116 $current = get_ transient( 'update_plugins' );116 $current = get_site_transient( 'update_plugins' ); 117 117 if ( ! is_object($current) ) 118 118 $current = new stdClass; … … 146 146 // Update last_checked for current to prevent multiple blocking requests if request hangs 147 147 $current->last_checked = time(); 148 set_ transient( 'update_plugins', $current );148 set_site_transient( 'update_plugins', $current ); 149 149 150 150 $to_send = (object)compact('plugins', 'active'); … … 171 171 $new_option->response = array(); 172 172 173 set_ transient( 'update_plugins', $new_option );173 set_site_transient( 'update_plugins', $new_option ); 174 174 } 175 175 … … 197 197 198 198 $installed_themes = get_themes( ); 199 $current_theme = get_ transient( 'update_themes' );199 $current_theme = get_site_transient( 'update_themes' ); 200 200 if ( ! is_object($current_theme) ) 201 201 $current_theme = new stdClass; … … 240 240 // Update last_checked for current to prevent multiple blocking requests if request hangs 241 241 $current_theme->last_checked = time(); 242 set_ transient( 'update_themes', $current_theme );242 set_site_transient( 'update_themes', $current_theme ); 243 243 244 244 $current_theme->template = get_option( 'template' ); … … 264 264 } 265 265 266 set_ transient( 'update_themes', $new_option );266 set_site_transient( 'update_themes', $new_option ); 267 267 } 268 268 … … 270 270 global $wp_version; 271 271 272 $current = get_ transient( 'update_core' );272 $current = get_site_transient( 'update_core' ); 273 273 274 274 if ( isset( $current->last_checked ) && … … 291 291 */ 292 292 function _maybe_update_plugins() { 293 $current = get_ transient( 'update_plugins' );293 $current = get_site_transient( 'update_plugins' ); 294 294 if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) ) 295 295 return; … … 307 307 */ 308 308 function _maybe_update_themes( ) { 309 $current = get_ transient( 'update_themes' );309 $current = get_site_transient( 'update_themes' ); 310 310 if( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) ) 311 311 return;
Note: See TracChangeset
for help on using the changeset viewer.