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

See #11095.

Built from https://develop.svn.wordpress.org/trunk@34653


git-svn-id: http://core.svn.wordpress.org/trunk@34617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-27 23:39:27 +00:00
parent a908b87996
commit b4ed533e66
2 changed files with 13 additions and 2 deletions

View File

@ -1264,10 +1264,21 @@ function wp_page_menu( $args = array() ) {
$list_args['title_li'] = '';
$menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
$container = sanitize_text_field( $args['container'] );
if ( $menu ) {
// wp_nav_menu doesn't set before and after
if ( isset( $args['fallback_cb'] ) &&
'wp_page_menu' === $args['fallback_cb'] &&
'ul' !== $container ) {
$args['before'] = '<ul>';
$args['after'] = '</ul>';
}
$menu = $args['before'] . $menu . $args['after'];
}
$container = sanitize_text_field( $args['container'] );
$attrs = '';
if ( ! empty( $args['menu_id'] ) ) {
$attrs .= ' id="' . esc_attr( $args['menu_id'] ) . '"';

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34652';
$wp_version = '4.4-alpha-34653';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.