Changeset 23912
- Timestamp:
- 04/04/2013 09:10:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r23749 r23912 167 167 $defaults = array( 'source' => '', 'destination' => '', //Please always pass these 168 168 'clear_destination' => false, 'clear_working' => false, 169 'abort_if_destination_exists' => true, 169 170 'hook_extra' => array()); 170 171 … … 225 226 else if ( ! $removed ) 226 227 return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); 227 } elseif ( $ wp_filesystem->exists($remote_destination) ) {228 } elseif ( $abort_if_destination_exists && $wp_filesystem->exists($remote_destination) ) { 228 229 //If we're not clearing the destination folder and something exists there already, Bail. 229 230 //But first check to see if there are actually any files in the folder. … … 273 274 'destination' => '', //And this 274 275 'clear_destination' => false, 276 'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please 275 277 'clear_working' => true, 276 278 'is_multi' => false, … … 319 321 'destination' => $destination, 320 322 'clear_destination' => $clear_destination, 323 'abort_if_destination_exists' => $abort_if_destination_exists, 321 324 'clear_working' => $clear_working, 322 325 'hook_extra' => $hook_extra … … 413 416 delete_site_transient('update_plugins'); 414 417 wp_cache_delete( 'plugins', 'plugins' ); 418 do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', 'type' => 'plugin' ), $package ); 415 419 416 420 return true; … … 458 462 delete_site_transient('update_plugins'); 459 463 wp_cache_delete( 'plugins', 'plugins' ); 464 do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'plugin' ), $plugin ); 460 465 } 461 466 … … 540 545 delete_site_transient('update_plugins'); 541 546 wp_cache_delete( 'plugins', 'plugins' ); 547 do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'plugin', 'bulk' => true ), $plugins ); 542 548 543 549 return $results; … … 765 771 // Force refresh of theme update information 766 772 wp_clean_themes_cache(); 773 do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', 'type' => 'theme' ), $package ); 767 774 768 775 return true; … … 811 818 // Force refresh of theme update information 812 819 wp_clean_themes_cache(); 820 do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'theme' ), $theme ); 813 821 814 822 return true; … … 898 906 // Force refresh of theme update information 899 907 wp_clean_themes_cache(); 908 do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'theme', 'bulk' => true ), $themes ); 900 909 901 910 return $results; … … 1068 1077 return new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] ); 1069 1078 1070 return update_core($working_dir, $wp_dir); 1079 $result = update_core( $working_dir, $wp_dir ); 1080 do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'core' ), $result ); 1081 return $result; 1071 1082 } 1072 1083
Note: See TracChangeset
for help on using the changeset viewer.