Upgrade/Install: Check that WordPress is installed before scheduling cleanup of the temp-backup directory.

Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

This addresses a  `Table 'wp_options' doesn't exist` error when running the installation with `WP_DEBUG` enabled.

Follow-up to [51815], [51898], [51899], [51902], [52192].

Props dlh, pbiron.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52284


git-svn-id: http://core.svn.wordpress.org/trunk@51876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-11-30 17:12:01 +00:00
parent 2caa789ee0
commit 5e35ad4b4a
2 changed files with 5 additions and 2 deletions

View File

@ -141,8 +141,11 @@ class WP_Upgrader {
public function init() {
$this->skin->set_upgrader( $this );
$this->generic_strings();
if ( ! wp_installing() ) {
$this->schedule_temp_backup_cleanup();
}
}
/**
* Schedule cleanup of the temp-backup directory.

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52283';
$wp_version = '5.9-alpha-52284';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.