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:
parent
ca27f326a9
commit
954a1c3bac
|
@ -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>
|
<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">
|
<div class="widget-position">
|
||||||
<table class="widefat"><thead><tr><th><?php _e('Sidebar'); ?></th><th><?php _e('Position'); ?></th></tr></thead><tbody>
|
<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>";
|
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 ) {
|
if ( 'wp_inactive_widgets' == $sbname ) {
|
||||||
echo ' ';
|
echo ' ';
|
||||||
} else {
|
} else {
|
||||||
if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
|
if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
|
||||||
$j = 1;
|
$j = 1;
|
||||||
|
$sidebars_widgets[$sbname] = array();
|
||||||
} else {
|
} else {
|
||||||
$j = count($sidebars_widgets[$sbname]);
|
$j = count($sidebars_widgets[$sbname]);
|
||||||
if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) )
|
if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) )
|
||||||
|
|
|
@ -970,7 +970,7 @@ function wp_get_sidebars_widgets($deprecated = true) {
|
||||||
$sidebars_widgets = get_option('sidebars_widgets', array());
|
$sidebars_widgets = get_option('sidebars_widgets', array());
|
||||||
$_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;
|
$sidebars_widgets['array_version'] = 3;
|
||||||
elseif ( !isset($sidebars_widgets['array_version']) )
|
elseif ( !isset($sidebars_widgets['array_version']) )
|
||||||
$sidebars_widgets['array_version'] = 1;
|
$sidebars_widgets['array_version'] = 1;
|
||||||
|
|
Loading…
Reference in New Issue