From b4ed533e6686f7ce51a155bf2095ff69b74775ec Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 27 Sep 2015 23:39:27 +0000 Subject: [PATCH] After [34200], force 'before' and 'after' to `` 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 --- wp-includes/post-template.php | 13 ++++++++++++- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 99deacc22b..a16f123074 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -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'] = ''; + } + $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'] ) . '"'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 03cb22b229..34ef74f672 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.