Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#14620 closed feature request (duplicate)

get_posts(): possible to allow "genre=1,2,3 " as in "cat=1,2,3"?

Reported by: bobsoap Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Taxonomy Keywords: get_posts, custom taxonomies, query
Focuses: Cc:


I've been trying to use get_posts with custom taxonomies. I now gave up and am doing manual sql queries instead, so this is just a suggestion:

  • allow multiple, comma-separated term IDs in the get_posts() attributes, just like for the attribute "cat".

This would make something like this possible:

$posts_in_Action_Western_Noir = get_posts('genre=2,5,12');

(where 2, 5, and 12 are the term IDs of the Action, Western and Noir terms)


Change History (1)

comment:1 @scribu5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

See #9951.

Note: See TracTickets for help on using tickets.