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:
parent
73fe9d548b
commit
77cf8a1184
@ -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
Block a user