Make WordPress Core


Ignore:
Timestamp:
07/14/2015 07:08:40 AM (9 years ago)
Author:
westonruter
Message:

Customizer: Improve performance of menus by caching results of wp_setup_nav_menu_item() calls.

Also fixes property list in phpdoc for wp_setup_nav_menu_item().

Fixes #32769.

File:
1 edited

Legend:

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

    r33218 r33256  
    497497                // Create a setting for each menu item (which doesn't actually manage data, currently).
    498498                $menu_item_setting_id = 'nav_menu_item[' . $item->ID . ']';
    499                 $this->manager->add_setting( new WP_Customize_Nav_Menu_Item_Setting( $this->manager, $menu_item_setting_id ) );
     499
     500                $value = (array) $item;
     501                $value['nav_menu_term_id'] = $menu_id;
     502                $this->manager->add_setting( new WP_Customize_Nav_Menu_Item_Setting( $this->manager, $menu_item_setting_id, array(
     503                    'value' => $value,
     504                ) ) );
    500505
    501506                // Create a control for each menu item.
Note: See TracChangeset for help on using the changeset viewer.