Make WordPress Core

Ticket #37893: 37893.patch

File 37893.patch, 1.0 KB (added by mdgl, 8 years ago)
  • wp-includes/widgets.php

     
    278278 * Removes a sidebar from the list.
    279279 *
    280280 * @since 2.2.0
     281 * @since x.y.0 The `$name` parameter was changed to also accept a numeric sidebar ID.
    281282 *
    282283 * @global array $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
    283284 *
    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.
    285286 */
    286287function unregister_sidebar( $name ) {
    287288        global $wp_registered_sidebars;
    288289
     290        $name = ( is_int($name) ) ? "sidebar-$name" : sanitize_title($name);
    289291        unset( $wp_registered_sidebars[ $name ] );
    290292}
    291293
     
    302304function is_registered_sidebar( $sidebar_id ) {
    303305        global $wp_registered_sidebars;
    304306
     307        $sidebar_id = ( is_int($sidebar_id) ) ? "sidebar-$sidebar_id" : sanitize_title($sidebar_id);
    305308        return isset( $wp_registered_sidebars[ $sidebar_id ] );
    306309}
    307310