Make WordPress Core


Ignore:
Timestamp:
10/08/2015 06:26:13 PM (10 years ago)
Author:
obenland
Message:

Template: Add fallback for empty containers.

Since [14031] the container can be omitted in wp_nav_menu(). It can not
however in wp_page_menu(), which creates a conflict if it is set as
the fallback, Let's make sure there is always a valid container tag.

Fixes #33974.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r34881 r34950  
    12761276    $container = sanitize_text_field( $args['container'] );
    12771277
     1278    // Fallback in case `wp_nav_menu()` was called without a container.
     1279    if ( empty( $container ) ) {
     1280        $container = 'div';
     1281    }
     1282
    12781283    if ( $menu ) {
    12791284
Note: See TracChangeset for help on using the changeset viewer.