From 4444fd3dc818523b8b16c145ddb1084d26379879 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Thu, 12 Sep 2024 14:47:06 -0400 Subject: [PATCH] Navigation: Highlight the handbook menu item when on handbook pages --- themes/wporg-5ftf-2024/inc/block-config.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/themes/wporg-5ftf-2024/inc/block-config.php b/themes/wporg-5ftf-2024/inc/block-config.php index 61d105d..19ef7fd 100644 --- a/themes/wporg-5ftf-2024/inc/block-config.php +++ b/themes/wporg-5ftf-2024/inc/block-config.php @@ -20,6 +20,8 @@ add_filter( 'render_block_core/post-excerpt', __NAMESPACE__ . '\inject_excerpt_m function add_site_navigation_menus( $menus ) { global $wp_query; + $is_handbook = function_exists( 'wporg_is_handbook' ) && wporg_is_handbook(); + $menu = array(); $menu[] = array( @@ -33,6 +35,7 @@ function add_site_navigation_menus( $menus ) { $menu[] = array( 'label' => __( 'Handbook', 'wporg-5ftf' ), 'url' => '/handbook/', + 'className' => $is_handbook ? 'current-menu-item' : '', ); $menu[] = array( 'label' => __( 'Pledges', 'wporg-5ftf' ),