WordPress.org

Make WordPress Core

Ticket #13220: highlight_home_link.2.diff

File highlight_home_link.2.diff, 687 bytes (added by ptahdunbar, 4 years ago)
  • wp-includes/nav-menu-template.php

     
    7575                if ( 'custom' != $item->object ) 
    7676                        $classes[] = 'menu-item-object-'. $item->object; 
    7777 
    78                 if ( $item->object_id == $wp_query->get_queried_object_id() ) 
     78                $requested_uri = home_url() . esc_url( $_SERVER['REQUEST_URI'] ); 
     79 
     80                if ( $item->object_id == $wp_query->get_queried_object_id() || ( 'custom' == $item->object && $item->url == $requested_uri ) ) 
    7981                        $classes[] = 'current-menu-item'; 
    8082 
    8183                // @todo add classes for parent/child relationships