Simplify the setting of `$args['include']` in `wp_get_nav_menu_items()`.
Props UmeshSingla. Fixes #28515. Built from https://develop.svn.wordpress.org/trunk@28825 git-svn-id: http://core.svn.wordpress.org/trunk@28629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0ba605c55c
commit
7b83df547d
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue