WordPress.org

Make WordPress Core

Changeset 34653


Ignore:
Timestamp:
09/27/2015 11:38:32 PM (4 years ago)
Author:
wonderboymusic
Message:

After [34200], force 'before' and 'after' to <ul> and </ul> when wp_nav_menu() falls back to wp_page_menu().

See #11095.

File:
1 edited

Legend:

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

    r34446 r34653  
    12651265    $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
    12661266
     1267    $container = sanitize_text_field( $args['container'] );
     1268
    12671269    if ( $menu ) {
     1270
     1271        // wp_nav_menu doesn't set before and after
     1272        if ( isset( $args['fallback_cb'] ) &&
     1273            'wp_page_menu' === $args['fallback_cb'] &&
     1274            'ul' !== $container ) {
     1275            $args['before'] = '<ul>';
     1276            $args['after'] = '</ul>';
     1277        }
     1278
    12681279        $menu = $args['before'] . $menu . $args['after'];
    12691280    }
    1270     $container = sanitize_text_field( $args['container'] );
     1281
    12711282    $attrs = '';
    12721283    if ( ! empty( $args['menu_id'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.