Make WordPress Core

Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#16718 closed enhancement (fixed)

Deprecate in_category in favor of has_category

Reported by: Otto42 Owned by: SergeyBiryukov
Priority: normal Milestone: 3.7
Component: Taxonomy Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

#12526 introduced has_category. There was some patches there which did and did not deprecate in_category.

End result is that they're now both in category-template.php, doing the exact same thing (serving as a wrapper to has_term).

I think we need some naming consistency here. Deprecate one or the other of them in 3.2, perhaps.

Attachments (1)

16718.patch​ (736 bytes ) - added by SergeyBiryukov 15 years ago.

Download all attachments as: .zip

Change History (8)

#1 @nacin
16 years ago

There was some discussion on this, possibly in IRC... Basically, in_category() is such an old function used by so much code, simply renaming it for pure consistency will be annoying, especially for reviewed themes. We're evil, but not that evil. Introducing has_category() but not deprecating is_category() seemed like a fine idea at the time.

#2 @Otto42
16 years ago

Ah.. well, in that case, it might be worth making one call the other in order to avoid duplicated code and/or to prevent future changes from not happening to both of them.

Also, might be worth switching twentyten to use has_category.

#3 @SergeyBiryukov
15 years ago

  • Keywords has-patch added; needs-patch removed

#4 @ericmann
13 years ago

  • Keywords commit added; 2nd-opinion removed

Patch looks good, and does exactly what was advertised. in_category() becomes an alias of has_category() without being deprecated (avoiding us being evil).

#5 @wonderboymusic
13 years ago

  • Milestone Awaiting Review → 3.7

#6 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 25119:

Make in_category() an alias of has_category(). fixes #16718.

#7 @ocean90
13 years ago

  • Type feature request → enhancement
Note: See TracTickets for help on using tickets.