WordPress.org

Make WordPress Core

Ticket #15017: body_class_tax.diff

File body_class_tax.diff, 619 bytes (added by nkuttler, 10 years ago)

Trivial patch

  • wp-includes/post-template.php

    diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
    index e860716..3afda9a 100644
    a b function get_body_class( $class = '' ) { 
    421421                        $tags = $wp_query->get_queried_object();
    422422                        $classes[] = 'tag';
    423423                        $classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id );
     424                } elseif ( is_tax() ) {
     425                        $taxes = $wp_query->get_queried_object();
     426                        $classes[] = 'tax';
     427                        $classes[] = 'tax-' . sanitize_html_class( $taxes->slug, $taxes->term_id );
    424428                }
    425429        } elseif ( is_page() ) {
    426430                $classes[] = 'page';