Fix conversion of old widget settings for Recent Posts, see #8441

git-svn-id: https://develop.svn.wordpress.org/trunk@11088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-04-26 05:34:06 +00:00
parent 1ad72b3d59
commit 78bb20529a
2 changed files with 15 additions and 8 deletions
+5 -2
View File
@@ -267,6 +267,9 @@ class WP_Widget {
function get_settings() {
$settings = get_option($this->option_name);
if ( false === $settings && isset($this->alt_option_name) )
$settings = get_option($this->alt_option_name);
if ( !is_array($settings) )
$settings = array();
@@ -976,9 +979,9 @@ function wp_convert_widget_settings($base_name, $option_name, $settings) {
if ( empty($settings) ) {
$single = true;
} else {
if ( isset($settings['number']) )
unset($settings['number']);
foreach ( array_keys($settings) as $number ) {
if ( 'number' == $number )
continue;
if ( !is_numeric($number) ) {
$single = true;
break;