Changeset 13698
- Timestamp:
- 03/14/2010 10:55:17 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r13098 r13698 462 462 * number the sidebar is currently when greater than one. If first sidebar, the 463 463 * name will be just "Sidebar". The default for id is "sidebar-" followed by the 464 * number the sidebar creation is currently at. 464 * number the sidebar creation is currently at. If the id is provided, and mutliple 465 * sidebars are being defined, the id will have "-2" appended, and so on. 465 466 * 466 467 * @since 2.2.0 … … 481 482 parse_str($args, $args); 482 483 483 for ( $i =1; $i <= $number; $i++ ) {484 for ( $i = 1; $i <= $number; $i++ ) { 484 485 $_args = $args; 485 486 486 if ( $number > 1 ) {487 if ( $number > 1 ) 487 488 $_args['name'] = isset($args['name']) ? sprintf($args['name'], $i) : sprintf(__('Sidebar %d'), $i); 488 } else {489 else 489 490 $_args['name'] = isset($args['name']) ? $args['name'] : __('Sidebar'); 490 } 491 492 if (isset($args['id'])) { 491 492 if ( isset($args['id']) ) { 493 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; 494 496 } else { 495 497 $n = count($wp_registered_sidebars); … … 497 499 $n++; 498 500 $_args['id'] = "sidebar-$n"; 499 } while ( isset($wp_registered_sidebars[$_args['id']]));501 } while ( isset($wp_registered_sidebars[$_args['id']]) ); 500 502 } 501 503
Note: See TracChangeset
for help on using the changeset viewer.