Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#14235 closed enhancement (fixed)

Add ability to remove ul tag from wp_nav_menu result

Reported by: spangborn Owned by: filosofo
Priority: normal Milestone: 3.1
Component: Template Version: 3.0
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

The new (and awesome) wp_nav_menu() function provides the ability to remove the "container" ( the DIV that wraps around the entire result), but you can't remove the UL that wraps the list items at present to only produce the list items. It'd be really awesome if it were possible to remove the UL tags, as it would enable theme designers/developers to use the new wp_nav_menu() inside of pre-existing UL's for things like inline navigation menus on the top of a page.

Attachments (1)

menu_items_wrap_class.14235.diff (1.5 KB ) - added by filosofo 16 years ago.

Download all attachments as: .zip

Change History (5)

#1 @filosofo
16 years ago

I agree, and I think the way to do it is to be able to pass element patterns. So for example something like this, perhaps:

$args = array(
   'items_wrap' => '<ul id="%1$s" class="%2$">%3$s</ul>',
);
wp_nav_menu( $args );

#2 @filosofo
16 years ago

  • Keywords has-patch added; wp_nav_menu removed
  • Milestone Awaiting Review3.1
  • Owner changed from spangborn to filosofo
  • Status newaccepted

#3 @nacin
16 years ago

  • Resolutionfixed
  • Status acceptedclosed

(In [16519]) Introduce items_wrap arg to wp_nav_menu(). props filosofo, fixes #14235.

#4 @nacin
16 years ago

(In [16520]) Escape the wrap ID and class attributes going into sprintf() and s/slug/wrap_id/ to make it more obvious. see #14235.

Note: See TracTickets for help on using tickets.