From 8dcd236ba3332228fa3415c0f5be6d66e7f39ff0 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sun, 14 Jun 2015 17:14:24 +0000 Subject: [PATCH] Nav menus: Reset the `fallback_cb` default argument in `wp_nav_menu` in case of a Customizer preview. props westonruter. see #32576. Built from https://develop.svn.wordpress.org/trunk@32763 git-svn-id: http://core.svn.wordpress.org/trunk@32734 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index a0499fb9ea..4194c506d4 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -230,6 +230,11 @@ function wp_nav_menu( $args = array() ) { 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '', 'depth' => 0, 'walker' => '', 'theme_location' => '' ); + // Prevent a fallback_cb in Customizer Preview to assist with has_nav_menu() and partial refresh. + if ( is_customize_preview() ) { + $defaults['fallback_cb'] = ''; + } + $args = wp_parse_args( $args, $defaults ); /** * Filter the arguments used to display a navigation menu. diff --git a/wp-includes/version.php b/wp-includes/version.php index 14a8666406..8b64198614 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32762'; +$wp_version = '4.3-alpha-32763'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.