Make WordPress Core


Ignore:
Timestamp:
10/24/2016 12:31:21 AM (8 years ago)
Author:
pento
Message:

Menus: Add the menu-item-home class to the static front page.

When a site is using a static front page, and that page is in a menu, it isn't given the CSS class menu-item-home, contrary to the developer documentation.

Props christophherr.
Fixes #35272.

File:
1 edited

Legend:

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

    r38574 r38882  
    377377                $classes[] = 'current_page_item';
    378378            }
     379
     380            if ( 'page_on_front' ) {
     381                $classes[] = 'menu-item-home';
     382            }
     383
    379384            $active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
    380385            $active_parent_object_ids[] = (int) $menu_item->post_parent;
Note: See TracChangeset for help on using the changeset viewer.