Make WordPress Core

Changeset 14824


Ignore:
Timestamp:
05/23/2010 10:01:08 PM (14 years ago)
Author:
nacin
Message:

Proper checks for current-menu-item. props duck_, fixes #13409.

File:
1 edited

Legend:

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

    r14793 r14824  
    8080        } else {
    8181            $classes[] = 'menu-item-object-'. $item->object;
    82             if ( $item->object_id == $wp_query->get_queried_object_id() )
     82            if (
     83                $item->object_id == $wp_query->get_queried_object_id() &&
     84                ( ( 'post_type' == $item->type && $wp_query->is_singular ) ||
     85                ( 'taxonomy' == $item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) ) )
     86            )
    8387                $classes[] = 'current-menu-item';
    8488        }
Note: See TracChangeset for help on using the changeset viewer.