WordPress.org

Make WordPress Core

Changeset 14923


Ignore:
Timestamp:
05/26/10 02:38:31 (4 years ago)
Author:
nacin
Message:

Handle current menu item classes for post pages. props filosofo, fixes #13543.

File:
1 edited

Legend:

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

    r14905 r14923  
    307307    $active_parent_object_ids = array(); 
    308308    $possible_object_parents = array(); 
     309    $home_page_id = (int) get_option( 'page_for_posts' ); 
    309310     
    310311    if ( $wp_query->is_singular && ! empty( $queried_object->post_type ) && ! is_post_type_hierarchical( $queried_object->post_type ) ) { 
     
    333334            $menu_item->object_id == $queried_object_id && 
    334335            (  
     336                ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id = $menu_item->object_id ) || 
    335337                ( 'post_type' == $menu_item->type && $wp_query->is_singular ) || 
    336338                ( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) )  
Note: See TracChangeset for help on using the changeset viewer.