Changeset 39211
- Timestamp:
- 11/13/2016 09:52:49 AM (7 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-plugin-upgrader.php
r37432 r39211 102 102 103 103 add_filter('upgrader_source_selection', array($this, 'check_package') ); 104 // Clear cache so wp_update_plugins() knows about the new plugin. 105 add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 ); 104 if ( $parsed_args['clear_update_cache'] ) { 105 // Clear cache so wp_update_plugins() knows about the new plugin. 106 add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 ); 107 } 106 108 107 109 $this->run( array( … … 169 171 add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); 170 172 //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins. 171 // Clear cache so wp_update_plugins() knows about the new plugin. 172 add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 ); 173 if ( $parsed_args['clear_update_cache'] ) { 174 // Clear cache so wp_update_plugins() knows about the new plugin. 175 add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 ); 176 } 173 177 174 178 $this->run( array( … … 228 232 229 233 add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); 230 add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );231 234 232 235 $this->skin->header(); … … 295 298 $this->maintenance_mode(false); 296 299 300 // Force refresh of plugin update information. 301 wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); 302 297 303 /** This action is documented in wp-admin/includes/class-wp-upgrader.php */ 298 304 do_action( 'upgrader_process_complete', $this, array( … … 308 314 309 315 // Cleanup our hooks, in case something else does a upgrade on this connection. 310 remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );311 316 remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); 312 313 // Force refresh of plugin update information.314 wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );315 317 316 318 return $results; -
trunk/src/wp-admin/includes/class-theme-upgrader.php
r37432 r39211 202 202 add_filter('upgrader_source_selection', array($this, 'check_package') ); 203 203 add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3); 204 // Clear cache so wp_update_themes() knows about the new theme. 205 add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); 204 if ( $parsed_args['clear_update_cache'] ) { 205 // Clear cache so wp_update_themes() knows about the new theme. 206 add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); 207 } 206 208 207 209 $this->run( array( … … 270 272 add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); 271 273 add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); 272 // Clear cache so wp_update_themes() knows about the new theme. 273 add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); 274 if ( $parsed_args['clear_update_cache'] ) { 275 // Clear cache so wp_update_themes() knows about the new theme. 276 add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 ); 277 } 274 278 275 279 $this->run( array( … … 330 334 add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); 331 335 add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); 332 // Clear cache so wp_update_themes() knows about the new theme.333 add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );334 336 335 337 $this->skin->header(); … … 395 397 $this->maintenance_mode(false); 396 398 399 // Refresh the Theme Update information 400 wp_clean_themes_cache( $parsed_args['clear_update_cache'] ); 401 397 402 /** This action is documented in wp-admin/includes/class-wp-upgrader.php */ 398 403 do_action( 'upgrader_process_complete', $this, array( … … 408 413 409 414 // Cleanup our hooks, in case something else does a upgrade on this connection. 410 remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );411 415 remove_filter('upgrader_pre_install', array($this, 'current_before')); 412 416 remove_filter('upgrader_post_install', array($this, 'current_after')); 413 417 remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme')); 414 415 // Refresh the Theme Update information416 wp_clean_themes_cache( $parsed_args['clear_update_cache'] );417 418 418 419 return $results;
Note: See TracChangeset
for help on using the changeset viewer.