WordPress.org

Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#4558 closed enhancement (fixed)

Allow category names in in_category()

Reported by: robmil Owned by: robmil
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.3
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Currently, in_category() only accepts the ID of a category, whereas is_category() accepts IDs, slugs and names. I think it's useful to be able to check if a post is in a given category based on its name as well as its ID, personally.

Attachments (1)

4558.diff (527 bytes) - added by robmil 13 years ago.

Download all attachments as: .zip

Change History (3)

@robmil
13 years ago

#1 @ryan
13 years ago

  • Milestone changed from 2.3 to 2.4

#2 @westi
12 years ago

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

(In [7030]) Support category names in in_category(). Fixes #4558 props robmil.

Note: See TracTickets for help on using tickets.