Ticket #7875: 7875.9.diff
File 7875.9.diff, 4.0 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/class-wp-upgrader.php
28 28 $this->skin = new WP_Upgrader_Skin(); 29 29 else 30 30 $this->skin = $skin; 31 } 32 33 function init() { 31 34 $this->skin->set_upgrader($this); 35 $this->generic_strings(); 32 36 } 33 37 34 38 function generic_strings() { … … 328 332 var $result; 329 333 330 334 function upgrade_strings() { 331 $this->generic_strings();332 335 $this->strings['up_to_date'] = __('The plugin is at the latest version.'); 333 336 $this->strings['no_package'] = __('Upgrade package not available.'); 334 337 $this->strings['downloading_package'] = __('Downloading update from %s.'); … … 341 344 } 342 345 343 346 function install_strings() { 344 $this->generic_strings();345 347 $this->strings['no_package'] = __('Install package not available.'); 346 348 $this->strings['downloading_package'] = __('Downloading install package from %s.'); 347 349 $this->strings['unpack_package'] = __('Unpacking the package.'); … … 352 354 353 355 function install($package) { 354 356 357 $this->init(); 355 358 $this->install_strings(); 356 359 357 360 $this->run(array( … … 369 372 370 373 function upgrade($plugin) { 371 374 375 $this->init(); 372 376 $this->upgrade_strings(); 373 377 374 378 $current = get_transient( 'update_plugins' ); … … 475 479 var $result; 476 480 477 481 function upgrade_strings() { 478 $this->generic_strings();479 482 $this->strings['up_to_date'] = __('The theme is at the latest version.'); 480 483 $this->strings['no_package'] = __('Upgrade package not available.'); 481 484 $this->strings['downloading_package'] = __('Downloading update from %s.'); … … 487 490 } 488 491 489 492 function install_strings() { 490 $this->generic_strings();491 493 $this->strings['no_package'] = __('Install package not available.'); 492 494 $this->strings['downloading_package'] = __('Downloading install package from %s.'); 493 495 $this->strings['unpack_package'] = __('Unpacking the package.'); … … 497 499 } 498 500 499 501 function install($package) { 500 502 503 $this->init(); 501 504 $this->install_strings(); 502 505 503 506 $options = array( … … 523 526 524 527 function upgrade($theme) { 525 528 529 $this->init(); 526 530 $this->upgrade_strings(); 527 531 528 532 // Is an update available? … … 616 620 617 621 } 618 622 619 //Untested. 623 620 624 class Core_Upgrader extends WP_Upgrader { 621 625 622 626 function upgrade_strings() { 623 $this->generic_strings();624 627 $this->strings['up_to_date'] = __('WordPress is at the latest version.'); 625 628 $this->strings['no_package'] = __('Upgrade package not available.'); 626 629 $this->strings['downloading_package'] = __('Downloading update from %s.'); … … 630 633 631 634 function upgrade($current) { 632 635 global $wp_filesystem; 636 637 $this->init(); 633 638 $this->upgrade_strings(); 634 639 635 636 640 if ( !empty($feedback) ) 637 641 add_filter('update_feedback', $feedback); 638 642 … … 732 736 } 733 737 734 738 function feedback($string) { 735 if ( isset( $this->upgrader->strings[$string] ) )739 if ( isset( $this->upgrader->strings[$string] ) ) 736 740 $string = $this->upgrader->strings[$string]; 737 741 738 742 if ( strpos($string, '%') !== false ) { … … 829 833 830 834 831 835 if ( ! $this->result || is_wp_error($this->result) ) 832 unset( $ update_actions['activate_plugin'] );836 unset( $install_actions['activate_plugin'] ); 833 837 834 838 $install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file); 835 839 if ( ! empty($install_actions) ) … … 885 889 $install_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . attribute_escape(__('Themes page')) . '" target="_parent">' . __('Return to Themes page') . '</a>'; 886 890 887 891 if ( ! $this->result || is_wp_error($this->result) ) 888 unset( $ update_actions['activate'], $update_actions['preview'] );892 unset( $install_actions['activate'], $install_actions['preview'] ); 889 893 890 894 $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info); 891 895 if ( ! empty($install_actions) )