From efaf9bae66921820df07107e15587fbbcabe9cad Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 24 Oct 2016 00:32:32 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@38882 git-svn-id: http://core.svn.wordpress.org/trunk@38825 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index e2c26411c8..de37cb3451 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 37664370a9..a14beb828f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38881'; +$wp_version = '4.7-alpha-38882'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.