Ticket #28145: 28145.diff
File 28145.diff, 1.6 KB (added by , 11 years ago) |
---|
-
tests/phpunit/tests/admin/includesTemplate.php
45 45 $this->assertEquals('', selected(0,false,false)); 46 46 $this->assertEquals('', checked(0,false,false)); 47 47 } 48 49 function test_wp_terms_checklist_decendants_and_self() { 50 ob_start(); 51 wp_terms_checklist( 0, array( 'decendants_and_self' => 1 ) ); 52 $actual = ob_get_clean(); 53 $expected = "\n<li id='category-1'><label class=\"selectit\"><input value=\"1\" type=\"checkbox\" name=\"post_category[]\" id=\"in-category-1\" disabled='disabled' /> Uncategorized</label></li>\n"; 54 $this->assertSame( $actual, $expected ); 55 } 48 56 } -
src/wp-admin/includes/template.php
202 202 ) ); 203 203 } 204 204 if ( $descendants_and_self ) { 205 $categories = (array) get_terms( $taxonomy, array( 206 'child_of' => $descendants_and_self, 207 'hierarchical' => 0, 208 'hide_empty' => 0 209 ) ); 205 206 if( is_taxonomy_hierarchical( $taxonomy ) ) { 207 $categories = (array) get_terms( $taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) ); 208 } else { 209 $categories = array(); 210 } 211 210 212 $self = get_term( $descendants_and_self, $taxonomy ); 211 213 array_unshift( $categories, $self ); 212 214 } else {