Changeset 6381 for trunk/wp-includes/widgets.php
- Timestamp:
- 12/14/2007 08:06:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r6364 r6381 14 14 15 15 function register_sidebars($number = 1, $args = array()) { 16 global $wp_registered_sidebars; 16 17 $number = (int) $number; 17 18 … … 21 22 for ( $i=1; $i <= $number; $i++ ) { 22 23 $_args = $args; 24 23 25 if ( $number > 1 ) { 24 $_args['name'] = isset($args['name']) ? $args['name']: sprintf(__('Sidebar %d'), $i);26 $_args['name'] = isset($args['name']) ? sprintf($args['name'], $i) : sprintf(__('Sidebar %d'), $i); 25 27 } else { 26 28 $_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar'); 27 29 } 28 $_args['id'] = isset($args['id']) ? $args['id'] : "sidebar-$i"; 30 31 if (isset($args['id'])) { 32 $_args['id'] = $args['id']; 33 } else { 34 $n = count($wp_registered_sidebars); 35 do { 36 $n++; 37 $_args['id'] = "sidebar-$n"; 38 } while (isset($wp_registered_sidebars[$_args['id']])); 39 } 40 29 41 register_sidebar($_args); 30 42 }
Note: See TracChangeset
for help on using the changeset viewer.