WordPress.org

Make WordPress Core

Ticket #36383: 36383.patch

File 36383.patch, 3.4 KB (added by ocean90, 4 years ago)
  • src/wp-admin/includes/class-wp-upgrader.php

     
    976976                add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
    977977                add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
    978978                //'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.
     979                // Clear cache so wp_update_plugins() knows about the new plugin.
     980                add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
    979981
    980982                $this->run( array(
    981983                        'package' => $r->package,
     
    990992                ) );
    991993
    992994                // Cleanup our hooks, in case something else does a upgrade on this connection.
     995                remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
    993996                remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
    994997                remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
    995998
     
    10321035                $current = get_site_transient( 'update_plugins' );
    10331036
    10341037                add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
     1038                add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
    10351039
    10361040                $this->skin->header();
    10371041
     
    11261130                $this->skin->footer();
    11271131
    11281132                // Cleanup our hooks, in case something else does a upgrade on this connection.
     1133                remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
    11291134                remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
    11301135
    11311136                // Force refresh of plugin update information.
     
    15441549                add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
    15451550                add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
    15461551                add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
     1552                // Clear cache so wp_update_themes() knows about the new theme.
     1553                add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
    15471554
    15481555                $this->run( array(
    15491556                        'package' => $r['package'],
     
    15571564                        ),
    15581565                ) );
    15591566
     1567                remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
    15601568                remove_filter('upgrader_pre_install', array($this, 'current_before'));
    15611569                remove_filter('upgrader_post_install', array($this, 'current_after'));
    15621570                remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
     
    16011609                add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
    16021610                add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
    16031611                add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
     1612                // Clear cache so wp_update_themes() knows about the new theme.
     1613                add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
    16041614
    16051615                $this->skin->header();
    16061616
     
    16771687                $this->skin->footer();
    16781688
    16791689                // Cleanup our hooks, in case something else does a upgrade on this connection.
     1690                remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
    16801691                remove_filter('upgrader_pre_install', array($this, 'current_before'));
    16811692                remove_filter('upgrader_post_install', array($this, 'current_after'));
    16821693                remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));