Changeset 39280
- Timestamp:
- 11/17/2016 06:01:13 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r38928 r39280 625 625 } 626 626 627 if ( $r['title_li'] && 'list' == $r['style'] )627 if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) { 628 628 $output .= '</ul></li>'; 629 } 629 630 630 631 /** -
trunk/tests/phpunit/tests/category/wpListCategories.php
r36008 r39280 264 264 265 265 $this->assertContains( '<li class="categories">Categories', $found ); 266 } 267 268 /** 269 * @ticket 38839 270 */ 271 public function test_hide_title_if_empty_should_not_output_stray_closing_tags() { 272 $cat = self::factory()->category->create(); 273 274 $found = wp_list_categories( array( 275 'echo' => false, 276 'show_option_none' => '', 277 'child_of' => 1, 278 'hide_title_if_empty' => true, 279 ) ); 280 281 $this->assertNotContains( '</ul></li>', $found ); 266 282 } 267 283
Note: See TracChangeset
for help on using the changeset viewer.