Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28515 closed enhancement (fixed)

wp_get_nav_menu_items using old syntax

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

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 11 years ago.
Updated args to send array value for include parameter

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
11 years ago

  • Component changed from General to Menus
  • Description modified (diff)
  • Focuses performance removed
  • Milestone changed from Awaiting Review to 4.0

@UmeshSingla
11 years ago

Updated args to send array value for include parameter

#2 @UmeshSingla
11 years ago

  • Keywords has-patch added

Updated argument works fine, tested on a new setup.

#3 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

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.