Invalid HTML in nested category checkbox list. Also cleans up source formatting a bit. Fixes #5462. Hat tip: 082net.

git-svn-id: https://develop.svn.wordpress.org/trunk@6392 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2007-12-16 21:40:36 +00:00
parent a3058bdbc2
commit 36fe99d069
1 changed files with 4 additions and 3 deletions

View File

@ -159,13 +159,14 @@ function get_nested_categories( $default = 0, $parent = 0 ) {
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></li>";
echo "\n", '<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";
echo "\n<ul>";
write_nested_categories( $category['children'] );
echo "</ul>\n";
echo "\n</ul>";
}
echo '</li>';
}
}