diff --git a/wp-includes/class-wp-widget.php b/wp-includes/class-wp-widget.php index e91f5cd9f9..086e9e9ffb 100644 --- a/wp-includes/class-wp-widget.php +++ b/wp-includes/class-wp-widget.php @@ -612,12 +612,16 @@ class WP_Widget { $settings = get_option( $this->option_name ); if ( false === $settings ) { + $settings = array(); if ( isset( $this->alt_option_name ) ) { - $settings = get_option( $this->alt_option_name ); - } else { - // Save an option so it can be autoloaded next time. - $this->save_settings( array() ); + // Get settings from alternative (legacy) option. + $settings = get_option( $this->alt_option_name, array() ); + + // Delete the alternative (legacy) option as the new option will be created using `$this->option_name`. + delete_option( $this->alt_option_name ); } + // Save an option so it can be autoloaded next time. + $this->save_settings( $settings ); } if ( ! is_array( $settings ) && ! ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 48c8ab8d87..7617a36523 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54111'; +$wp_version = '6.1-alpha-54112'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.