Bootstrap/Load: Remove extension from the list of paused extensions when it is deactivated.

With this change, fatal errors recorded before a plugin was deactivated or a theme was switched away from do not persist. This ensures that re-enabling it re-checks for fatal errors correctly.

Props aandrewdixon, dhanukanuwan, henrywright.
Fixes #46812.

Built from https://develop.svn.wordpress.org/trunk@45115


git-svn-id: http://core.svn.wordpress.org/trunk@44924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2019-04-05 15:33:52 +00:00
parent 6d58109b09
commit 5d2c761568
3 changed files with 12 additions and 1 deletions

View File

@ -768,6 +768,11 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
}
}
if ( $do_blog && wp_is_recovery_mode() ) {
list( $extension ) = explode( '/', $plugin );
wp_paused_plugins()->delete( $extension );
}
if ( ! $silent ) {
/**
* Fires as a specific plugin is being deactivated.

View File

@ -744,6 +744,12 @@ function switch_theme( $stylesheet ) {
$new_theme = wp_get_theme( $stylesheet );
$template = $new_theme->get_template();
if ( wp_is_recovery_mode() ) {
$paused_themes = wp_paused_themes();
$paused_themes->delete( $old_theme->get_stylesheet() );
$paused_themes->delete( $old_theme->get_template() );
}
update_option( 'template', $template );
update_option( 'stylesheet', $stylesheet );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta1-45114';
$wp_version = '5.2-beta1-45115';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.