Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#9960 closed defect (bug) (fixed)

get_terms() fails to work with parent=0

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by: filosofo's profile filosofo
Milestone: 2.8 Priority: normal
Severity: major Version: 2.8
Component: Taxonomy Keywords: has-patch tested dev-feedback
Focuses: Cc:

Description

It then returns all terms.

Attachments (1)

9960.diff (1.1 KB) - added by Denis-de-Bernardy 15 years ago.

Download all attachments as: .zip

Change History (5)

#1 follow-up: @filosofo
15 years ago

I can't reproduce this on trunk. When I query get_terms('category','parent=0'); it returns all categories at the top of the hierarchy. In other words, those without parents, which is the expected behavior.

#2 @Denis-de-Bernardy
15 years ago

  • Keywords has-patch tested dev-feedback added

Attached patch makes it work as expected, and I found no trace of the argument getting used in WP. It might have some minor side effects on plugins.

Please give early feedback, so I whether I should seek a workaround for my plugin.

#3 in reply to: ↑ 1 @Denis-de-Bernardy
15 years ago

Replying to filosofo:

I can't reproduce this on trunk. When I query get_terms('category','parent=0'); it returns all categories at the top of the hierarchy. In other words, those without parents, which is the expected behavior.

It what I thought too, until I added a post in the empty subcat I created to verify.

#4 @ryan
15 years ago

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

(In [11476]) Fix parent=0 queries. Props Denis-de-Bernardy 107 minutes ago. . fixes #9960

Note: See TracTickets for help on using tickets.