Unset some vars when done with them to reduce peak memory usage. see #12734
git-svn-id: https://develop.svn.wordpress.org/trunk@14559 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c0e02a6677
commit
b726ce95dc
|
@ -241,8 +241,10 @@ function wp_nav_menu( $args = array() ) {
|
||||||
$sorted_menu_items = array();
|
$sorted_menu_items = array();
|
||||||
foreach ( (array) $menu_items as $key => $menu_item )
|
foreach ( (array) $menu_items as $key => $menu_item )
|
||||||
$sorted_menu_items[$menu_item->menu_order] = $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 );
|
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
|
||||||
|
unset($sorted_menu_items);
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
$attributes = ' id="menu-' . $menu->slug . '"';
|
$attributes = ' id="menu-' . $menu->slug . '"';
|
||||||
|
@ -258,6 +260,7 @@ function wp_nav_menu( $args = array() ) {
|
||||||
} else {
|
} else {
|
||||||
$nav_menu .= $items;
|
$nav_menu .= $items;
|
||||||
}
|
}
|
||||||
|
unset($items);
|
||||||
|
|
||||||
$nav_menu .= '</ul>';
|
$nav_menu .= '</ul>';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue