~canonical-sysadmins/wordpress/4.7.2

« back to all changes in this revision

Viewing changes to wp-admin/includes/class-plugin-upgrader.php

  • Committer: Haw Loeung
  • Date: 2016-12-13 06:56:21 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: haw.loeung@canonical.com-20161213065621-8tcu7u7vlxgs2s81
Merge WP4.7 from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
                $this->install_strings();
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(
108
110
                        'package' => $package,
168
170
                add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
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(
175
179
                        'package' => $r->package,
227
231
                $current = get_site_transient( 'update_plugins' );
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();
233
236
 
294
297
 
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(
299
305
                        'action' => 'update',
307
313
                $this->skin->footer();
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
317
 
313
 
                // Force refresh of plugin update information.
314
 
                wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
315
 
 
316
318
                return $results;
317
319
        }
318
320