Changeset 34950
- Timestamp:
- 10/08/2015 06:26:13 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r34881 r34950 1276 1276 $container = sanitize_text_field( $args['container'] ); 1277 1277 1278 // Fallback in case `wp_nav_menu()` was called without a container. 1279 if ( empty( $container ) ) { 1280 $container = 'div'; 1281 } 1282 1278 1283 if ( $menu ) { 1279 1284 -
trunk/tests/phpunit/tests/post/template.php
r34654 r34950 282 282 /** 283 283 * @ticket 11095 284 * @ticket 33974 284 285 */ 285 286 public function test_wp_page_menu_wp_nav_menu_fallback() { … … 294 295 // After falling back, the 'after' argument should be set and output as '</ul>'. 295 296 $this->assertRegExp( '/<\/ul><\/div>/', $menu ); 297 298 // No menus + wp_nav_menu() falls back to wp_page_menu(), this time without a container. 299 $menu = wp_nav_menu( array( 300 'echo' => false, 301 'container' => false, 302 ) ); 303 304 // After falling back, the empty 'container' argument should still return a container element. 305 $this->assertRegExp( '/<div class="menu">/', $menu ); 296 306 } 297 307 }
Note: See TracChangeset
for help on using the changeset viewer.