diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php
index 45d9e47de4..dc684c327e 100644
a
|
b
|
function _wp_menu_item_classes_by_context( &$menu_items ) { |
553 | 553 | if ( in_array( 'current-menu-parent', $classes ) ) { |
554 | 554 | $classes[] = 'current_page_parent'; |
555 | 555 | } |
556 | | if ( in_array( 'current-menu-ancestor', $classes ) ) { |
557 | | $classes[] = 'current_page_ancestor'; |
558 | | } |
| 556 | } |
| 557 | |
| 558 | if ( in_array( 'current-menu-ancestor', $classes ) ) { |
| 559 | $classes[] = sprintf( 'current_%s_ancestor', $parent_item->object ); |
559 | 560 | } |
560 | 561 | |
561 | 562 | $menu_items[ $key ]->classes = array_unique( $classes ); |