WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#6749 closed enhancement (invalid)

in_category needs to be able to take more than one category...

Reported by: Otto42 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.5
Component: Template Keywords: needs-testing 2nd-opinion has-patch
Focuses: Cc:

Description

Reference:
http://wordpress.org/support/topic/169575

When I first replied, I thought in_category(array(7,8,9,10,11)) would work, since a lot of the 2.5 template functions were enhanced to support multiple checking like this. Imagine my surprise when looking through the code that in_category apparently got missed.

Patch attached. Not sure if it works properly though, it needs testing and feedback.

Attachments (1)

in_category.diff (1.1 KB) - added by Otto42 6 years ago.
First attempt at allowing in_category to support arrays of inputs

Download all attachments as: .zip

Change History (3)

Otto426 years ago

First attempt at allowing in_category to support arrays of inputs

comment:1 Denis-de-Bernardy5 years ago

fixed in trunk, no?

comment:2 Denis-de-Bernardy5 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

see is_object_in_term(), which gets called by in_category()

Note: See TracTickets for help on using tickets.