From 6e54e12aedae473c7477fa2690a9723a295d049b Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Sun, 14 Jun 2015 17:13:23 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@32763 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/nav-menu-template.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/nav-menu-template.php b/src/wp-includes/nav-menu-template.php index a0499fb9ea..4194c506d4 100644 --- a/src/wp-includes/nav-menu-template.php +++ b/src/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.