dont show items when menu empty, See #11817

git-svn-id: https://develop.svn.wordpress.org/trunk@13354 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ron Rennick 2010-02-24 00:37:15 +00:00
parent fb4b78214b
commit 7623fc24ac

View File

@ -56,6 +56,7 @@ function wp_get_nav_menus() {
function wp_get_nav_menu_items( $menu, $args = array() ) {
$items = get_objects_in_term( (int) $menu, 'nav_menu' );
if ( ! empty( $items ) ) {
$defaults = array( 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order' );
$args = wp_parse_args($args, $defaults);
if ( count( $items ) > 1 )
@ -73,9 +74,9 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
unset($items);
ksort($output);
return $output;
} else {
return $items;
}
}
return $items;
}
function setup_menu_item($menu_item, $type = 'item', $position = 0) {