Unset some vars when done with them to reduce peak memory usage. see #12734

git-svn-id: http://svn.automattic.com/wordpress/trunk@14559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-11 14:39:00 +00:00
parent a491596163
commit 2b930efb74
1 changed files with 3 additions and 0 deletions

View File

@ -241,8 +241,10 @@ function wp_nav_menu( $args = array() ) {
$sorted_menu_items = array();
foreach ( (array) $menu_items as $key => $menu_item )
$sorted_menu_items[$menu_item->menu_order] = $menu_item;
unset($menu_items);
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
unset($sorted_menu_items);
// Attributes
$attributes = ' id="menu-' . $menu->slug . '"';
@ -258,6 +260,7 @@ function wp_nav_menu( $args = array() ) {
} else {
$nav_menu .= $items;
}
unset($items);
$nav_menu .= '</ul>';