Fix bad incrementor in widgets. Props mdawaffe. fixes #6350

git-svn-id: http://svn.automattic.com/wordpress/trunk@7469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-22 08:17:37 +00:00
parent a370785fbc
commit 058a14bccc

View File

@ -64,7 +64,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
if ( $is_multi ) {
// it's a multi-widget. We only need to show it in the list once.
$already_shown[] = $widget['callback'];
$num = array_pop( explode( '-', $widget['id'] ) );
$num = (int) array_pop( explode( '-', $widget['id'] ) );
$id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];
// so that we always add a new one when clicking "add"
while ( isset($wp_registered_widgets["$id_base-$num"]) )