Changeset 43712
- Timestamp:
- 10/11/2018 04:41:39 AM (5 years ago)
- Location:
- branches/5.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0
-
branches/5.0/src/wp-includes/class-walker-category.php
r41688 r43712 100 100 101 101 // Don't generate an element if the category name is empty. 102 if ( !$cat_name ) {102 if ( '' === $cat_name ) { 103 103 return; 104 104 } -
branches/5.0/tests/phpunit/tests/category/wpListCategories.php
r39280 r43712 88 88 } 89 89 90 public function list_cats_callback( $cat ) { 91 if ( 'Test Cat 1' === $cat ) { 92 return ''; 93 } 94 95 return $cat; 96 } 97 98 /** 99 * @ticket 44872 100 */ 101 public function test_should_create_element_when_cat_name_is_zero() { 102 $c = self::factory()->category->create( 103 array( 104 'name' => '0', 105 ) 106 ); 107 108 $found = wp_list_categories( 109 array( 110 'hide_empty' => false, 111 'echo' => false, 112 ) 113 ); 114 115 $this->assertContains( "cat-item-$c", $found ); 116 $this->assertContains( '0', $found ); 117 } 118 90 119 public function test_show_option_all_link_should_go_to_home_page_when_show_on_front_is_false() { 91 120 $cats = self::factory()->category->create_many( 2 ); … … 206 235 207 236 $this->assertContains( "<li class='cat-item-all'><a href='" . $url . "'>All</a></li>", $found ); 208 }209 210 public function list_cats_callback( $cat ) {211 if ( 'Test Cat 1' === $cat ) {212 return '';213 }214 215 return $cat;216 237 } 217 238
Note: See TracChangeset
for help on using the changeset viewer.