Ticket #37470: 37470.2.diff
File 37470.2.diff, 1.2 KB (added by , 8 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
3678 3678 3679 3679 wp_update_plugins(); 3680 3680 3681 // save whether the plugin is active or not 3682 $plugin_active = is_plugin_active( $plugin ); 3683 $plugin_network_active = is_plugin_active_for_network( $plugin ); 3684 3685 // silently deactivates the plugin prior to upgrading it 3686 add_filter('upgrader_pre_install', array($upgrader, 'deactivate_plugin_before_upgrade'), 10, 2); 3687 3681 3688 $skin = new Automatic_Upgrader_Skin(); 3682 3689 $upgrader = new Plugin_Upgrader( $skin ); 3683 3690 $result = $upgrader->bulk_upgrade( array( $plugin ) ); … … 3691 3698 } 3692 3699 3693 3700 if ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) { 3701 3702 // Silently reactivate the plugin afterwards 3703 if ( !is_wp_error( $result ) && $plugin_active ) { 3704 // plugin_info() is called in case the main plugin file name changed 3705 $plugin = $upgrader->plugin_info(); 3706 activate_plugin( $plugin, '', $plugin_network_active, true ); 3707 } 3708 3694 3709 $plugin_update_data = current( $result ); 3695 3710 3696 3711 /*