Changeset 13699
- Timestamp:
- 03/14/2010 11:34:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r13698 r13699 490 490 $_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar'); 491 491 492 if ( isset($args['id']) ) { 493 $_args['id'] = $args['id']; 494 if ( $number > 1 ) // Ensure that for multiple additions, the ID is unique (even if specified). Append -xx for > 1 sidebars. 495 $_args['id'] .= '-' . $i; 496 } else { 497 $n = count($wp_registered_sidebars); 498 do { 499 $n++; 500 $_args['id'] = "sidebar-$n"; 501 } while ( isset($wp_registered_sidebars[$_args['id']]) ); 502 } 492 $id = isset($args['id']) ? $args['id'] : 'sidebar'; 493 $_args['id'] = $id; 494 495 $n = count($wp_registered_sidebars); 496 while ( isset($wp_registered_sidebars[$_args['id']]) ) 497 $_args['id'] = $id . '-' . $n++; 503 498 504 499 register_sidebar($_args);
Note: See TracChangeset
for help on using the changeset viewer.