Make WordPress Core

Opened 9 years ago

Closed 5 years ago

#8722 closed defect (bug) (fixed)

get_categories allows custom taxos, get_category doesn't

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


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 8 years ago.
8722.2.diff (941 bytes) - added by wonderboymusic 5 years ago.
8722.3.diff (3.2 KB) - added by wonderboymusic 5 years ago.

Download all attachments as: .zip

Change History (11)

#1 @ryan
9 years ago

  • Milestone changed from 2.9 to Future Release

8 years ago

#2 @wojtek.szkutnik
8 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
8 years ago

  • Keywords gsoc added

#4 @wonderboymusic
5 years ago

  • Keywords needs-testing gsoc removed
  • Milestone changed from Future Release to 3.7

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

#5 @DrewAPicture
5 years ago

  • Cc xoodrew@… added

#6 @nacin
5 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
5 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
5 years ago

  • Resolution set to fixed
  • Status changed from new to 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.