Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#9960 closed defect (bug) (fixed)

get_terms() fails to work with parent=0

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

Description

It then returns all terms.

Attachments (1)

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

Download all attachments as: .zip

Change History (5)

#1 follow-up: @filosofo
17 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
17 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
17 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
17 years ago

  • Resolution → fixed
  • Status new → closed

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

Note: See TracTickets for help on using tickets.