Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#28515 closed enhancement (fixed)

wp_get_nav_menu_items using old syntax

Reported by: evandentremont Owned by: wonderboymusic
Priority: normal Milestone: 4.0
Component: Menus Version: 3.9.1
Severity: normal Keywords: has-patch
Cc: Focuses:

Description (last modified by SergeyBiryukov)

In nav-menu.php, function wp_get_nav_menu_items()

if ( count( $items ) > 1 )
	$args['include'] = implode( ',', $items );
else
	$args['include'] = $items[0];

can be replaced by

$args['include'] = items;

"Beginning with Version 3.0, an array of Page ID also can be used." I presume that applies to posts as well since posts page says to "See also get_pages() for example parameter usage."

Attachments (1)

28515.diff (637 bytes ) - added by UmeshSingla 12 years ago.
Updated args to send array value for include parameter

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
12 years ago

  • Component GeneralMenus
  • Description modified (diff)
  • Focuses performance removed
  • Milestone Awaiting Review4.0

@UmeshSingla
12 years ago

Updated args to send array value for include parameter

#2 @UmeshSingla
12 years ago

  • Keywords has-patch added

Updated argument works fine, tested on a new setup.

#3 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 28825:

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

Props UmeshSingla.
Fixes #28515.

Note: See TracTickets for help on using tickets.