Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 6 weeks ago

#24100 closed enhancement (invalid)

wp_nav_menu before and after argument tweak

Reported by: clorith's profile Clorith Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.5.1
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

When using the 'before', 'after' and link equivilants WP outputs the menu with these added to the first/last elements as well;

wp_nav_menu( array( 'before' => '|' ) );

The above will output as |Item1|Item2, but for a menu separator this does not make sense as the first item doesn't need to be separated before it begins, appropriate output should be Item1|Item2.

Attachments (1)

24100.patch (904 bytes) - added by Clorith 11 years ago.

Download all attachments as: .zip

Change History (5)

@Clorith
11 years ago

#1 follow-up: @dd32
11 years ago

It sounds like this would break any use cases where before is a opening HTML tag, and the after is a closing HTML tag, correct?

What you really want, is a new parameter which specifies a separator?

#2 in reply to: ↑ 1 @Clorith
11 years ago

Replying to dd32:

It sounds like this would break any use cases where before is a opening HTML tag, and the after is a closing HTML tag, correct?

What you really want, is a new parameter which specifies a separator?

Ahh yes, I didn't think of it being used to add extra html tags at all, but yes a new separator argument would probably be a better approach then.

#3 @Clorith
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Better suited for a new ticket with enhancement added in #24101

  • Closed this ticket as it isn't relevant due to various use cases for the before and after arguments

#4 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.