mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-25 21:54:28 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@38882 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -376,6 +376,11 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
|
||||
$classes[] = 'page-item-' . $menu_item->object_id;
|
||||
$classes[] = 'current_page_item';
|
||||
}
|
||||
|
||||
if ( 'page_on_front' ) {
|
||||
$classes[] = 'menu-item-home';
|
||||
}
|
||||
|
||||
$active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
|
||||
$active_parent_object_ids[] = (int) $menu_item->post_parent;
|
||||
$active_object = $menu_item->object;
|
||||
|
||||
Reference in New Issue
Block a user