Links widget has duplicate ID issue
|Reported by:||Otto42||Owned by:||mdawaffe|
Description (last modified by rob1n)
wp_list_bookmarks can generate several "blocks" in the sidebar, one per category. In combination with the links widget, this can produce several list items (LI) all using the same id. This will cause the site to fail validation, since there are duplicated ID's.
The reason this happens is because dynamic_sidebar() builds the "before_widget" string using replacements for $1 and $2 as the id and class, respectively. This string then gets passed to wp_list_bookmarks as the "category_before" parameter.
What really needs to occur, in this particular case, is that the original, unreplaced, before_widget string needs to get "$1" replaced with "%id", allowing the normal wp_list_bookmarks code to work correctly, ensuring a unique ID for each of the bookmark blocks.
What the right was to do this is, I'm not entirely certain. We could copy the original string to $params['original_before_widget'] and then let wp_widget_links handle it correctly by doing its own replacement. That would work.