WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6722 closed defect (bug) (fixed)

wp_list_bookmarks() bug when filtering on category_name

Reported by: drdavid Owned by: ryan
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords:
Focuses: Cc:

Description

When supplying the category_name argument to wp_list_bookmarks() in an attempt to only obtain the bookmarks in that category, this fails.

I have traced the error back to the following line (line 175 in wp_includes/bookmark-template.php in revision 7634):

$cats = get_terms('link_category', "category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0");

The argument to get_terms() is wrong, it should be name__like= instead of category_name=:

$cats = get_terms('link_category', "name__like=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0");

Works for me.

Change History (5)

comment:1 @ryan7 years ago

  • Owner changed from anonymous to ryan

comment:2 @ryan7 years ago

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

(In [8104]) category_name is not a valid arg. Use namelike. Props drdavid. fixes #6722 for trunk

comment:3 @ryan7 years ago

(In [8105]) category_name is not a valid arg. Use namelike. Props drdavid. fixes #6722 for 2.5

comment:4 @ryan7 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

comment:5 @westi7 years ago

  • Milestone changed from 2.9 to 2.6
Note: See TracTickets for help on using tickets.