Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#15017 closed defect (bug) (fixed)

get_body_class() doesn't return information about the current custom taxonomy archive

Reported by: nkuttler Owned by: nkuttler
Priority: normal Milestone: 3.1
Component: Taxonomy Version:
Severity: normal Keywords: has-patch, ui-feedback
Cc: Focuses:

Description

Custom taxonomy archives don't get a body class added. Patch attached.

Attachments (4)

body_class_tax.diff​ (619 bytes ) - added by nkuttler 16 years ago.
Trivial patch
body_class_tax2.diff​ (665 bytes ) - added by nkuttler 16 years ago.
body_class_tax2.2.diff​ (656 bytes ) - added by nkuttler 16 years ago.
body_class_tax.trunk.diff​ (684 bytes ) - added by nkuttler 16 years ago.

Download all attachments as: .zip

Change History (12)

#1 @nkuttler
16 years ago

The first patch was flawed. The second one adds

tax-$taxonomy and
tax-$taxonomy-$term

which makes this usable.

#2 @hakre
16 years ago

why not <body class="... tax-$taxonomy term-$term ...">?

that would save the $taxonomy duplication and both can be combined in css selectors by concatenation (body.tax-$taxonomy.term-$term). Additionally, from a styling perspective the same term can be addressed across taxonomies

#3 @nkuttler
16 years ago

Sounds perfect. tax-$taxonomy-$term is cumbersome indeed.

#4 @nkuttler
16 years ago

  • Keywords ui-feedback added

#5 @nkuttler
16 years ago

  • Owner set to nkuttler
  • Status new → accepted

#6 @dd32
16 years ago

Would it be worth sanitizing the taxonomy name as well?

#7 @nkuttler
16 years ago

Indeed, and I've cleanup up the patch a bit.

#8 @nacin
16 years ago

  • Milestone Awaiting Review → 3.1
  • Resolution → fixed
  • Status accepted → closed
Note: See TracTickets for help on using tickets.