Ticket #37893: 37893.1.patch
File 37893.1.patch, 1.4 KB (added by , 8 years ago) |
---|
-
wp-includes/widgets.php
278 278 * Removes a sidebar from the list. 279 279 * 280 280 * @since 2.2.0 281 * @since x.y.0 The `$name` parameter was changed to also accept a numeric sidebar ID. 281 282 * 282 283 * @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID. 283 284 * 284 * @param string $name The ID of the sidebar when it was added.285 * @param string|int $name The ID of the sidebar when it was registered. 285 286 */ 286 287 function unregister_sidebar( $name ) { 287 288 global $wp_registered_sidebars; 288 289 290 $name = ( is_numeric($name) ) ? "sidebar-$name" : sanitize_title($name); 289 291 unset( $wp_registered_sidebars[ $name ] ); 290 292 } 291 293 … … 296 298 * 297 299 * @global array $wp_registered_sidebars Registered sidebars. 298 300 * 299 * @param string|int $ sidebar_id The ID of the sidebar when it was registered.301 * @param string|int $name The ID of the sidebar when it was registered. 300 302 * @return bool True if the sidebar is registered, false otherwise. 301 303 */ 302 function is_registered_sidebar( $ sidebar_id) {304 function is_registered_sidebar( $name ) { 303 305 global $wp_registered_sidebars; 304 306 305 return isset( $wp_registered_sidebars[ $sidebar_id ] ); 307 $name = ( is_numeric($name) ) ? "sidebar-$name" : sanitize_title($name); 308 return isset( $wp_registered_sidebars[ $name ] ); 306 309 } 307 310 308 311 /**