Use a for loop where it's more appropriate. Fixes #5234 props darkdragon and DD32.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e0cf58bfb
commit
5fb4d6ab00
|
@ -18,9 +18,7 @@ function register_sidebars($number = 1, $args = array()) {
|
||||||
if ( is_string($args) )
|
if ( is_string($args) )
|
||||||
parse_str($args, $args);
|
parse_str($args, $args);
|
||||||
|
|
||||||
$i = 1;
|
for ( $i=1; $i <= $number; $i++ ) {
|
||||||
|
|
||||||
while ( $i <= $number ) {
|
|
||||||
$_args = $args;
|
$_args = $args;
|
||||||
if ( $number > 1 ) {
|
if ( $number > 1 ) {
|
||||||
$_args['name'] = isset($args['name']) ? $args['name'] : sprintf(__('Sidebar %d'), $i);
|
$_args['name'] = isset($args['name']) ? $args['name'] : sprintf(__('Sidebar %d'), $i);
|
||||||
|
@ -29,7 +27,6 @@ function register_sidebars($number = 1, $args = array()) {
|
||||||
}
|
}
|
||||||
$_args['id'] = isset($args['id']) ? $args['id'] : "sidebar-$i";
|
$_args['id'] = isset($args['id']) ? $args['id'] : "sidebar-$i";
|
||||||
register_sidebar($_args);
|
register_sidebar($_args);
|
||||||
++$i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue