Make WordPress Core


Ignore:
Timestamp:
07/08/2015 08:17:52 PM (8 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r33094 r33131  
    772772        $args['can_partial_refresh'] = $can_partial_refresh;
    773773
     774        $hashed_args = $args;
     775
    774776        if ( ! $can_partial_refresh ) {
    775             $args['fallback_cb'] = '';
    776             $args['walker'] = '';
    777         }
    778 
    779         ksort( $args );
    780         $args['args_hash'] = $this->hash_nav_menu_args( $args );
    781 
    782         $this->preview_nav_menu_instance_args[ $this->preview_nav_menu_instance_number ] = $args;
     777            $hashed_args['fallback_cb'] = '';
     778            $hashed_args['walker'] = '';
     779        }
     780
     781        ksort( $hashed_args );
     782        $hashed_args['args_hash'] = $this->hash_nav_menu_args( $hashed_args );
     783
     784        $this->preview_nav_menu_instance_args[ $this->preview_nav_menu_instance_number ] = $hashed_args;
    783785        return $args;
    784786    }
Note: See TracChangeset for help on using the changeset viewer.