Changeset 13700
- Timestamp:
- 03/14/2010 11:58:53 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r13699 r13700 482 482 parse_str($args, $args); 483 483 484 $n = count($wp_registered_sidebars); 484 485 for ( $i = 1; $i <= $number; $i++ ) { 485 486 $_args = $args; … … 490 491 $_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar'); 491 492 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++; 498 493 // Custom specified ID's are suffixed if they exist already. 494 // Automatically generated sidebar names need to be suffixed regardless. 495 if ( isset($args['id']) ) { 496 $_args['id'] = $args['id']; 497 while ( isset($wp_registered_sidebars[$_args['id']]) ) 498 $_args['id'] = $args['id'] . '-' . $n++; 499 } else { 500 do { 501 $_args['id'] = 'sidebar-' . $n++; 502 } while ( isset($wp_registered_sidebars[$_args['id']]) ); 503 } 499 504 register_sidebar($_args); 500 505 }
Note: See TracChangeset
for help on using the changeset viewer.