Make WordPress Core

Opened 15 years ago

Closed 12 years ago

Last modified 12 years ago

#16718 closed enhancement (fixed)

Deprecate in_category in favor of has_category

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

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
15 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
15 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
12 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
12 years ago

  • Milestone changed from Awaiting Review to 3.7

#6 @SergeyBiryukov
12 years ago

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

In 25119:

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

#7 @ocean90
12 years ago

  • Type changed from feature request to enhancement
Note: See TracTickets for help on using tickets.