﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
5462,invalid nested category HTML list in admin,082net,anonymous,"'dropdown_categories' function in wp-admin/includes/template.php returns invalid html list
{{{
<ul>
 <li>a</li>
 <li>b</li>
 <ul>
  <li>b-1</li>
  <li>b-2</li>
 </ul>
<li>c</li>
</ul>
}}}

It should be
{{{
<ul>
 <li>a</li>
 <li>b
 <ul>
  <li>b-1</li>
  <li>b-2</li>
 </ul>
 </li>
<li>c</li>
</ul>
}}}

We just need to print '</li>' after child list if a category has children.
{{{
function write_nested_categories( $categories ) {
	foreach ( $categories as $category ) {
		echo '<li id=""category-', $category['cat_ID'], '""><label for=""in-category-', $category['cat_ID'], '"" class=""selectit""><input value=""', $category['cat_ID'], '"" type=""checkbox"" name=""post_category[]"" id=""in-category-', $category['cat_ID'], '""', ($category['checked'] ? ' checked=""checked""' : """" ), '/> ', wp_specialchars( apply_filters('the_category', $category['cat_name'] )), ""</label>"";

		if ( $category['children'] ) {
			echo ""<ul>\n"";
			write_nested_categories( $category['children'] );
			echo ""</ul>\n"";
		}
		echo ""</li>"";
	}
}
}}}


It displayed well on blog, but while I was trying to make 'AJAX category adder for specific parent category', it matters.",enhancement,closed,normal,2.5,General,2.3.1,normal,fixed,has-patch,
