Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#25892 closed enhancement (fixed)

tax_query docs

Reported by: afercia Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version:
Component: WordPress.org site Keywords:
Focuses: Cc:


hi, not 100% sure but on tax_query documentation http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

Taxonomy Parameters > tax_query > field (string) - Select taxonomy term by ('id' or 'slug')

shouldn't be by ('term_id' or 'slug')?

All references I see in the core use term_id. In a custom tax_query if I use 'id' I get 1 additional query to get... the term_id :-) If I directly use 'term_id' it saves 1 query.

Change History (3)

#1 @nacin
4 years ago

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

It's supposed to be term_id, yes. Though 'id' simply falls through a default branch and ends up being 'term_id' anyway. I updated the Codex.

#2 @afercia
4 years ago

ok, thx very much mr. Nacin :)

#3 @ocean90
4 years ago

  • Milestone changed from Awaiting Review to WordPress.org
Note: See TracTickets for help on using tickets.