#5234 closed enhancement (fixed)
widgets.php a while that should be a for loop
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.5 | Priority: | lowest |
| Severity: | trivial | Version: | 2.5 |
| Component: | Optimization | Keywords: | widgets has-patch commit |
| Focuses: | Cc: |
Description
In widgets.php file, contained in register_sidebars(), lines 72-82, there is a while loop that uses $i. It first sets $i to a value, then checks to make sure it is in a range, then it increments $i. I repeat, this is a while loop.
for($i=1; $i <= $number; ++$i)
{
$_args = $args;
if ( $number > 1 ) {
$_args['name'] = isset($args['name']) ? $args['name'] : sprintf(__('Sidebar %d'), $i);
} else {
$_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar');
}
$_args['id'] = isset($args['id']) ? $args['id'] : "sidebar-$i";
register_sidebar($_args);
}
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
(In [6275]) Use a for loop where it's more appropriate. Fixes #5234 props darkdragon and DD32.