WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#3371 closed enhancement (duplicate)

Request for additional $before and $after parameters to wp_list_bookmarks()

Reported by: vdzhuvinov Owned by: westi
Milestone: Priority: low
Severity: trivial Version: 2.0.5
Component: Template Keywords:
Focuses: Cc:

Description

Listing template functions such as get_archives() or get_links()
normally include parameters to include custom HTML code before or after
the listed items.

I need a $before parameter because certain browsers still have poor
support for the CSS :before directive and such a feature would
circumvent this problem.

[suggestion initially posted on the wp-hackers list]

Change History (8)

comment:1 @vdzhuvinov9 years ago

  • Type changed from defect to enhancement

comment:2 @foolswisdom9 years ago

  • Milestone changed from 2.0.6 to 2.1

Please look at the code in trunk (2.1) as some work as been done in wp_list_bookmarks which I think relates, but I am a novice. Does this relate to ticket:3361 ?

comment:3 @ryan9 years ago

Something similar can be done here, yes.

comment:4 @westi9 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

We can easyily add wp_list_bookmarks alike $before and $after support to wp_list_categories in trunk (wp_list_cats is deprecated).

However, for now you may be able to get what you want by adding style=none to the arguments for the function call.

The before and after li tags are toggled by this:

http://trac.wordpress.org/browser/trunk/wp-includes/category-template.php#L231

if ( $title_li && 'list' == $style )
    $output = '<li class="categories">' . $r['title_li'] . '<ul>';

And

http://trac.wordpress.org/browser/trunk/wp-includes/category-template.php#L250

if ( $title_li && 'list' == $style )
    $output .= '</ul></li>';

I'll add the before and after support to my todo list.

comment:5 @matt8 years ago

  • Milestone changed from 2.1 to 2.2

comment:6 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

comment:7 @rob1n8 years ago

  • Summary changed from Request for additional $before and $after parameters to wp_list_cats() to Request for additional $before and $after parameters to wp_list_bookmarks()

comment:8 @rob1n8 years ago

  • Milestone 2.3 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Will be addressed for 2.3 by #3567.

Note: See TracTickets for help on using tickets.