WordPress.org

Make WordPress Core

Changeset 15856


Ignore:
Timestamp:
10/20/10 09:32:16 (7 years ago)
Author:
nacin
Message:

Body classes for custom taxonomies and terms. props nkuttler, fixes #15017.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r15819 r15856  
    423423            $classes[] = 'tag'; 
    424424            $classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id ); 
     425        } elseif ( is_tax() ) { 
     426            $term = $wp_query->get_queried_object(); 
     427            $classes[] = 'tax-' . sanitize_html_class( $term->taxonomy ); 
     428            $classes[] = 'term-' . sanitize_html_class( $term->slug, $term->term_id ); 
    425429        } 
    426430    } elseif ( is_page() ) { 
Note: See TracChangeset for help on using the changeset viewer.