WordPress.org

Make WordPress Core

Changeset 6392


Ignore:
Timestamp:
12/16/07 21:40:36 (7 years ago)
Author:
matt
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r6380 r6392  
    160160function write_nested_categories( $categories ) { 
    161161    foreach ( $categories as $category ) { 
    162         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>"; 
     162        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>'; 
    163163 
    164164        if ( $category['children'] ) { 
    165             echo "<ul>\n"; 
     165            echo "\n<ul>"; 
    166166            write_nested_categories( $category['children'] ); 
    167             echo "</ul>\n"; 
    168         } 
     167            echo "\n</ul>"; 
     168        } 
     169        echo '</li>'; 
    169170    } 
    170171} 
Note: See TracChangeset for help on using the changeset viewer.