WordPress.org

Make WordPress Core

Ticket #14256: register_sidebar.patch

File register_sidebar.patch, 493 bytes (added by wjm, 4 years ago)

sets the id based on the title, not on the order it has been registered

  • widgets.php

     
    545545 
    546546        $defaults = array( 
    547547                'name' => sprintf(__('Sidebar %d'), $i ), 
    548                 'id' => "sidebar-$i", 
     548                'id' => !empty( $args['name'] ) ? 'sidebar-'.sanitize_title_with_dashes( $args['name'] ) : "sidebar-$i", 
    549549                'description' => '', 
    550550                'before_widget' => '<li id="%1$s" class="widget %2$s">', 
    551551                'after_widget' => "</li>\n",