Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#16353 closed enhancement (wontfix)

Allow element between li's but not after final element in wp_list_bookmarks

Reported by: in2thats12 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch close
Focuses: Cc:


Many times when displaying a list, one wants a separator between the list elements. Using the "after" arg would cause the separator to be displayed after the last element also.

To this end, I added the "li_between" option to the _walk_bookmarks function which places the contents of "li_between" after each list element, but not after the final list element.

Patch attached.

Attachments (1)

bookmark-template.patch (1.2 KB) - added by in2thats12 7 years ago.

Download all attachments as: .zip

Change History (5)

#1 @scribu
7 years ago

  • Keywords has-patch added; has_patch removed

#2 @nacin
7 years ago

  • Keywords close added

This opens up a rabbit hole of inconsistency, with so many walkers and li's throughout WP.

This seems like something that should be done through CSS. Keep in mind you have last-child and plenty of other ways of selecting elements.

#3 @toscho
7 years ago

  • Cc info@… added

List items cannot have other siblings than list items. Anything else is invalid markup:

  <hr> <!-- invalid -->

Why should WP help to create broken HTML?

#4 @scribu
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.