From 9e26f1db4c2ba364d73096990aab111a69b86cd7 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 8 Jul 2015 20:18:27 +0000 Subject: [PATCH] Customizer: Prevent loss of `walker` and `fallback_cb` args for `wp_nav_menu`. These args only need to be cleared out when exported to JavaScript, when they are not JSON-serializable. So the filter now clears these when gathering args for exporting to JS, but otherwise now leaves the original values to be passed through to `wp_nav_menu()`. Fixes #32781. Built from https://develop.svn.wordpress.org/trunk@33131 git-svn-id: http://core.svn.wordpress.org/trunk@33102 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-nav-menus.php | 12 +++++++----- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index e7b7e0f505..c13ed93ba7 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -771,15 +771,17 @@ final class WP_Customize_Nav_Menus { ); $args['can_partial_refresh'] = $can_partial_refresh; + $hashed_args = $args; + if ( ! $can_partial_refresh ) { - $args['fallback_cb'] = ''; - $args['walker'] = ''; + $hashed_args['fallback_cb'] = ''; + $hashed_args['walker'] = ''; } - ksort( $args ); - $args['args_hash'] = $this->hash_nav_menu_args( $args ); + ksort( $hashed_args ); + $hashed_args['args_hash'] = $this->hash_nav_menu_args( $hashed_args ); - $this->preview_nav_menu_instance_args[ $this->preview_nav_menu_instance_number ] = $args; + $this->preview_nav_menu_instance_args[ $this->preview_nav_menu_instance_number ] = $hashed_args; return $args; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 411d364050..34a2992e29 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta1-33130'; +$wp_version = '4.3-beta1-33131'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.