Changeset 43605
- Timestamp:
- 09/02/2018 10:08:05 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-walker-category.php
r43571 r43605 105 105 106 106 // Don't generate an element if the category name is empty. 107 if ( !$cat_name ) {107 if ( '' === $cat_name ) { 108 108 return; 109 109 } -
trunk/tests/phpunit/tests/category/wpListCategories.php
r43571 r43605 104 104 } 105 105 106 public function list_cats_callback( $cat ) { 107 if ( 'Test Cat 1' === $cat ) { 108 return ''; 109 } 110 111 return $cat; 112 } 113 114 /** 115 * @ticket 44872 116 */ 117 public function test_should_create_element_when_cat_name_is_zero() { 118 $c = self::factory()->category->create( 119 array( 120 'name' => '0', 121 ) 122 ); 123 124 $found = wp_list_categories( 125 array( 126 'hide_empty' => false, 127 'echo' => false, 128 ) 129 ); 130 131 $this->assertContains( "cat-item-$c", $found ); 132 $this->assertContains( '0', $found ); 133 } 134 106 135 public function test_show_option_all_link_should_go_to_home_page_when_show_on_front_is_false() { 107 136 $cats = self::factory()->category->create_many( 2 ); … … 248 277 } 249 278 250 public function list_cats_callback( $cat ) {251 if ( 'Test Cat 1' === $cat ) {252 return '';253 }254 255 return $cat;256 }257 258 279 /** 259 280 * @ticket 33460
Note: See TracChangeset
for help on using the changeset viewer.