WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#10721 closed defect (bug) (fixed)

is_tax() fails with a parameter

Reported by: scribu Owned by: filosofo
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

Suppose 'jazz' is a term in the 'genre' taxonomy, with posts.

Go to ?genre=jazz.

is_tax() => true
is_tax('genre') => false

Attachments (1)

query.php.diff (461 bytes) - added by scribu 6 years ago.
working patch

Download all attachments as: .zip

Change History (14)

comment:1 @scribu6 years ago

  • Cc scribu@… added

@scribu6 years ago

working patch

comment:2 @scribu6 years ago

  • Keywords has-patch added

comment:3 follow-up: @ryan6 years ago

I wonder if it should search for both taxonomy and term since we don't have an is_term() equivalent (is_term() is already used in taxonomy.php for something else). Hmm, maybe is_tax_term(). Anyhow, I'm wondering if is_tax() is being used by plugins to search term slugs, since that's what it currently (and erroneously) does.

comment:4 in reply to: ↑ 3 @scribu6 years ago

  • Cc scribu@… removed

Replying to ryan:

I wonder if it should search for both taxonomy and term since we don't have an is_term() equivalent (is_term() is already used in taxonomy.php for something else). Hmm, maybe is_tax_term().

is_tax_term() sounds good.

Anyhow, I'm wondering if is_tax() is being used by plugins to search term slugs, since that's what it currently (and erroneously) does.

Doesn't really matter, does it?

comment:5 @automattor6 years ago

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

(In [12316]) Fix is_tax(). Props scribu. fixes #10721

comment:6 @pavelevap5 years ago

  • Cc pavelevap@… added
  • Milestone changed from 2.9 to 2.9.2
  • Priority changed from normal to high
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 2.9 to 2.9.1

I upgraded from WordPress 2.8.6 to WordPress 2.9.1.
Fix 12316 probably broke my tax conditions.
Before this fix is_tax() and is_tax('slug') worked well.
Now (after upgrade) only is_tax() works. Slug is not recognized.
When I downgrade my 2.9.1 query.php file back to 12316 everything works again.

comment:7 @pavelevap5 years ago

Sorry, invalid. I used is_tax() also for taxonomy term which is now really broken. is_tax_term() would be really appreciated...

comment:8 @scribu5 years ago

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

Please open a new ticket for is_tax_term().

[Now what do I set the milestone to?]

comment:9 @filosofo5 years ago

  • Milestone changed from 2.9.2 to 2.9

comment:10 @scribu5 years ago

Thanks, I don't have access to completed milestones.

comment:11 @dd325 years ago

  • Priority changed from high to normal
  • Version changed from 2.9.1 to 2.9

Just reverting the other metadata changes.

comment:12 @vteixeira4 years ago

  • Cc victorhteixeira@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 2.9 to 3.0.4

This is still broken on 3.04.

comment:13 @scribu4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version changed from 3.0.4 to 2.9

Please don't re-open tickets closed in a previous milestone.

If you can reproduce the problem on the development version (3.1-RC), open a new ticket.

Otherwise, use the support forums.

Note: See TracTickets for help on using tickets.