Fix warning in wp-admin/widgets.php when using Accessibility Mode on brand new install, fixes #10610

git-svn-id: http://svn.automattic.com/wordpress/trunk@11824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-08-16 01:56:21 +00:00
parent ca27f326a9
commit 954a1c3bac
2 changed files with 4 additions and 2 deletions

View File

@ -252,13 +252,15 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
<p class="describe"><?php _e('Select both the sidebar for this widget and the position of the widget in that sidebar.'); ?></p>
<div class="widget-position">
<table class="widefat"><thead><tr><th><?php _e('Sidebar'); ?></th><th><?php _e('Position'); ?></th></tr></thead><tbody>
<?php foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
<?php
foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr($sbname) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
if ( 'wp_inactive_widgets' == $sbname ) {
echo '&nbsp;';
} else {
if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
$j = 1;
$sidebars_widgets[$sbname] = array();
} else {
$j = count($sidebars_widgets[$sbname]);
if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) )

View File

@ -970,7 +970,7 @@ function wp_get_sidebars_widgets($deprecated = true) {
$sidebars_widgets = get_option('sidebars_widgets', array());
$_sidebars_widgets = array();
if ( isset($sidebars_widgets['wp_inactive_widgets']) )
if ( isset($sidebars_widgets['wp_inactive_widgets']) || empty($sidebars_widgets) )
$sidebars_widgets['array_version'] = 3;
elseif ( !isset($sidebars_widgets['array_version']) )
$sidebars_widgets['array_version'] = 1;