From b5be742e1f910b90ff2fd55063cdc5833d631833 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 8 Oct 2015 18:27:25 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@34950 git-svn-id: http://core.svn.wordpress.org/trunk@34915 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 1c98e49ede..3b491a1ace 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1275,6 +1275,11 @@ function wp_page_menu( $args = array() ) { $container = sanitize_text_field( $args['container'] ); + // Fallback in case `wp_nav_menu()` was called without a container. + if ( empty( $container ) ) { + $container = 'div'; + } + if ( $menu ) { // wp_nav_menu doesn't set before and after diff --git a/wp-includes/version.php b/wp-includes/version.php index 42e9682922..4ef2d6e7f1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34949'; +$wp_version = '4.4-alpha-34950'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.