Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13435 closed defect (bug) (invalid)

Can't Query a Term from a Custom Taxonomy

Reported by: developdaly Owned by: ryan
Milestone: Priority: high
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:


Using the following query I should be able to return a subset of posts with a post type of "listing" in a custom taxonomy of "listing-neighborhood" and term/tag ID of "12".


/?taxonomy=listing-neighborhood&post_type=listing works, but I'm not able to specify a term.

I was told this may be due to post_tag still being hardcoded into query.php around line 1940 instead of a term variable.

Change History (7)

comment:1 @developdaly5 years ago

  • Component changed from General to Query
  • Owner set to ryan

comment:2 @wpmuguru5 years ago



When using custom taxonomies you are using terms not tags. It would be confusing if tag_id were able to query any term taxonomy.

comment:3 @wpmuguru5 years ago

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

marking as invalid

comment:4 @developdaly5 years ago

So is there not a method of retrieving terms by their ID?

The backend makes use of /wp-admin/edit-tags.php?action=edit&taxonomy=listing-neighborhood&post_type=listing&tag_ID=12.

comment:5 @hakre5 years ago

Is there a term_ID maybe?

comment:6 @hakre5 years ago

I just looked a bit in WP_Query and it looks like there are no input point to use it querying for a nunerical term_id.

get_category() might be helpfull in that case to convert the numerical id into a category object first and obtain the name.

comment:7 @nacin5 years ago

  • Milestone 3.0 deleted
Note: See TracTickets for help on using tickets.