Make WordPress Core

Opened 18 years ago

Closed 13 years ago

#8722 closed defect (bug) (fixed)

get_categories allows custom taxos, get_category doesn't

Reported by: Malaiac Owned by: ryan
Priority: normal Milestone: 3.7
Component: Taxonomy Version: 2.7
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

get_categories('type=link') works with custom taxonomies (since ​http://trac.wordpress.org/ticket/7427 ).
get_category('... ?') doesn't.
get_category > get_term($category,'category');

Because of that, all category dependent functions, like wp_list_categories and such, are broken when working with non post categories. get_category doesn't even work with link categories.

Attachments (3)

8722.diff​ (991 bytes ) - added by wojtek.szkutnik 16 years ago.
8722.2.diff​ (941 bytes ) - added by wonderboymusic 13 years ago.
8722.3.diff​ (3.2 KB ) - added by wonderboymusic 13 years ago.

Download all attachments as: .zip

Change History (11)

#1 @ryan
17 years ago

  • Milestone 2.9 → Future Release

#2 @wojtek.szkutnik
16 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing added; custom-taxonomies removed

Hm, shouldn't all these functions use wp_get_args instead of separate arguments?

#3 @wojtek.szkutnik
16 years ago

  • Keywords gsoc added

#4 @wonderboymusic
13 years ago

  • Keywords needs-testing gsoc removed
  • Milestone Future Release → 3.7

This is harmless, but might not be necessary. Let us discuss.

#5 @DrewAPicture
13 years ago

  • Cc xoodrew@… added

#6 @nacin
13 years ago

It might make more sense to convert all uses of get_category() to get_term(), in functions like wp_list_categories() that are generic and take a taxonomy argument. Otherwise this change doesn't actually help, unless you use the filter, which is very confusing.

#7 @wonderboymusic
13 years ago

  • Keywords commit added

It might make more sense to convert all uses of get_category() to get_term()

Yes, and it actually removes the need for _make_cat_compat() in the functions that are only looking for one property. .3.diff​ does this.

#8 @wonderboymusic
13 years ago

  • Resolution → fixed
  • Status new → closed

In 25662:

Rather than adding a taxonomy arg to get_category(), convert all uses of get_category() in core to get_term(). By doing so, we negate the need to call _make_cat_compat() in a few places that are only looking for a single property.

Fixes #8722.

Note: See TracTickets for help on using tickets.