Simplify the setting of $args['include'] in wp_get_nav_menu_items().

Props UmeshSingla.
Fixes #28515.


git-svn-id: https://develop.svn.wordpress.org/trunk@28825 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
wonderboymusic 2014-06-24 17:16:02 +00:00
parent 73fe9d548b
commit 77cf8a1184

View File

@ -547,10 +547,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
$defaults = array( 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item',
'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order', 'nopaging' => true );
$args = wp_parse_args( $args, $defaults );
if ( count( $items ) > 1 )
$args['include'] = implode( ',', $items );
else
$args['include'] = $items[0];
$args['include'] = $items;
$items = get_posts( $args );