Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#10721 closed defect (bug) (fixed)

is_tax() fails with a parameter

Reported by: scribu's profile scribu Owned by: filosofo's profile 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 15 years ago.
working patch

Download all attachments as: .zip

Change History (14)

#1 @scribu
15 years ago

  • Cc scribu@… added

@scribu
15 years ago

working patch

#2 @scribu
15 years ago

  • Keywords has-patch added

#3 follow-up: @ryan
15 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.

#4 in reply to: ↑ 3 @scribu
15 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?

#5 @automattor
15 years ago

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

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

#6 @pavelevap
15 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.

#7 @pavelevap
15 years ago

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

#8 @scribu
15 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?]

#9 @filosofo
15 years ago

  • Milestone changed from 2.9.2 to 2.9

#10 @scribu
15 years ago

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

#11 @dd32
15 years ago

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

Just reverting the other metadata changes.

#12 @vteixeira
14 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.

#13 @scribu
14 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.