Changeset 35102 for trunk/src/wp-includes/widget-functions.php
- Timestamp:
- 10/13/2015 01:32:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widget-functions.php
r34566 r35102 97 97 $_args['id'] = $args['id']; 98 98 $n = 2; // Start at -2 for conflicting custom ID's 99 while ( is set($wp_registered_sidebars[$_args['id']]) )99 while ( is_registered_sidebar( $_args['id'] ) ) { 100 100 $_args['id'] = $args['id'] . '-' . $n++; 101 } 101 102 } else { 102 $n = count( $wp_registered_sidebars);103 $n = count( $wp_registered_sidebars ); 103 104 do { 104 105 $_args['id'] = 'sidebar-' . ++$n; 105 } while ( is set($wp_registered_sidebars[$_args['id']]) );106 } while ( is_registered_sidebar( $_args['id'] ) ); 106 107 } 107 108 register_sidebar($_args); … … 204 205 205 206 unset( $wp_registered_sidebars[ $name ] ); 207 } 208 209 /** 210 * Checks if a sidebar is registered. 211 * 212 * @since 4.4.0 213 * 214 * @global array $wp_registered_sidebars Registered sidebars. 215 * 216 * @param string $name The ID of the sidebar when it was added. 217 * 218 * @return bool True if the sidebar is registered, false otherwise. 219 */ 220 function is_registered_sidebar( $name ) { 221 global $wp_registered_sidebars; 222 return isset( $wp_registered_sidebars[ $name ] ); 206 223 } 207 224
Note: See TracChangeset
for help on using the changeset viewer.