WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 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:

Description

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 4 years ago.
Add

Download all attachments as: .zip

Change History (5)

@in2thats124 years ago

Add

comment:1 @scribu4 years ago

  • Keywords has-patch added; has_patch removed

comment:2 @nacin4 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.

comment:3 @toscho4 years ago

  • Cc info@… added

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

<ul>
  <li>
  <hr> <!-- invalid -->
  <li>
</ul>

Why should WP help to create broken HTML?

comment:4 @scribu4 years ago

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