WordPress.org

Make WordPress Core

Ticket #35272: 35272.diff

File 35272.diff, 557 bytes (added by christophherr, 4 years ago)

Adds the class .menu-item-home to a page set as front page when it is added to a navigation menu through the "Pages" metabox in Apperance - Menus.

  • nav-menu-template.php

     
    574574                                $classes[] = 'page-item-' . $menu_item->object_id;
    575575                                $classes[] = 'current_page_item';
    576576                        }
     577
     578                        if ( 'page_on_front' ) {
     579                                $classes[] = 'menu-item-home';
     580                        }
     581
    577582                        $active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
    578583                        $active_parent_object_ids[] = (int) $menu_item->post_parent;
    579584                        $active_object = $menu_item->object;