mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Taxonomy: Prevent wp_list_categories() from producing not well-nested output if hide_title_if_empty is true.
Props chesio. Fixes #38839. See #33460. git-svn-id: https://develop.svn.wordpress.org/trunk@39280 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -265,6 +265,22 @@ class Tests_Category_WpListCategories extends WP_UnitTestCase {
|
||||
$this->assertContains( '<li class="categories">Categories', $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 38839
|
||||
*/
|
||||
public function test_hide_title_if_empty_should_not_output_stray_closing_tags() {
|
||||
$cat = self::factory()->category->create();
|
||||
|
||||
$found = wp_list_categories( array(
|
||||
'echo' => false,
|
||||
'show_option_none' => '',
|
||||
'child_of' => 1,
|
||||
'hide_title_if_empty' => true,
|
||||
) );
|
||||
|
||||
$this->assertNotContains( '</ul></li>', $found );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 12981
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user