WordPress.org

Make WordPress Core

Opened 19 months ago

Closed 16 months ago

Last modified 16 months 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:

Description

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)

comment:1 @nacin16 months 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.

comment:2 @afercia16 months ago

ok, thx very much mr. Nacin :)

comment:3 @ocean9016 months ago

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