Skip to content

Commit

Permalink
Add menu-item-home class to Navigation for front page
Browse files Browse the repository at this point in the history
Closes #29423
  • Loading branch information
George Hotelling committed Dec 17, 2021
1 parent 9d4474c commit 91dc798
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/page-list/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
}
}

$front_page_id = (int) get_option( 'page_on_front' );
if ( (int) $page['page_id'] === $front_page_id ) {
$css_class .= ' menu-item-home';
}

$title = wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) );
$aria_label = sprintf(
/* translators: Accessibility text. %s: Parent page title. */
Expand Down

0 comments on commit 91dc798

Please sign in to comment.