Changeset 14881 for trunk/wp-includes/nav-menu-template.php
- Timestamp:
- 05/25/2010 02:25:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/nav-menu-template.php
r14876 r14881 293 293 } 294 294 } 295 } elseif ( ! empty( $queried_object->post_type ) && is_post_type_hierarchical( $queried_object->post_type ) ) { 296 _get_post_ancestors( $queried_object ); 295 297 } 296 298 … … 334 336 335 337 // set parent's class 336 if ( ! empty( $active_parent_item_ids ) || ! empty( $active_parent_object_ids )) {337 foreach( (array) $menu_items as $key => $parent_item ) {338 if ( in_array( $parent_item->db_id, $active_parent_item_ids ) )339 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-menu-parent' );340 if ( in_array( $parent_item->object_id, $active_parent_object_ids ) )341 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $active_object . '-parent' );342 }338 foreach( (array) $menu_items as $key => $parent_item ) { 339 if ( 'post_type' == $parent_item->type && is_post_type_hierarchical( $queried_object->post_type ) && in_array( $parent_item->object_id, $queried_object->ancestors ) ) 340 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $queried_object->post_type . '-ancestor' ); 341 if ( in_array( $parent_item->db_id, $active_parent_item_ids ) ) 342 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-menu-parent' ); 343 if ( in_array( $parent_item->object_id, $active_parent_object_ids ) ) 344 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $active_object . '-parent' ); 343 345 } 344 346 }
Note: See TracChangeset
for help on using the changeset viewer.