Taxonomy: Revert [43620] from the 4.9 branch.

This change is out of the 4.9.x scope, and will be reintroduced in 5.0.x.

See #44872.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43711 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2018-10-11 04:41:28 +00:00
parent 50b9728d6a
commit ad319d3c85
2 changed files with 9 additions and 30 deletions

View File

@ -99,7 +99,7 @@ class Walker_Category extends Walker {
);
// Don't generate an element if the category name is empty.
if ( '' === $cat_name ) {
if ( ! $cat_name ) {
return;
}

View File

@ -87,35 +87,6 @@ class Tests_Category_WpListCategories extends WP_UnitTestCase {
$this->assertNotContains( 'Test Cat 1', $found );
}
public function list_cats_callback( $cat ) {
if ( 'Test Cat 1' === $cat ) {
return '';
}
return $cat;
}
/**
* @ticket 44872
*/
public function test_should_create_element_when_cat_name_is_zero() {
$c = self::factory()->category->create(
array(
'name' => '0',
)
);
$found = wp_list_categories(
array(
'hide_empty' => false,
'echo' => false,
)
);
$this->assertContains( "cat-item-$c", $found );
$this->assertContains( '0', $found );
}
public function test_show_option_all_link_should_go_to_home_page_when_show_on_front_is_false() {
$cats = self::factory()->category->create_many( 2 );
@ -236,6 +207,14 @@ class Tests_Category_WpListCategories extends WP_UnitTestCase {
$this->assertContains( "<li class='cat-item-all'><a href='" . $url . "'>All</a></li>", $found );
}
public function list_cats_callback( $cat ) {
if ( 'Test Cat 1' === $cat ) {
return '';
}
return $cat;
}
/**
* @ticket 33460
*/