Skip to content

Commit

Permalink
Local Navigation: Set the WP-CLI Commands page to current when on the…
Browse files Browse the repository at this point in the history
… archive landing page.

Fixes #498
  • Loading branch information
ryelle committed Feb 28, 2024
1 parent 69b4f3a commit 694fe41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/wp-content/themes/wporg-developer-2023/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ function set_site_breadcrumbs() {
* Provide a list of local navigation menus.
*/
function add_site_navigation_menus( $menus ) {
global $wp;
$is_cli_home = ( is_archive() && isset( $wp->request ) && 'cli/commands' === $wp->request );
return array(
'developer' => array(
array(
Expand All @@ -582,6 +584,7 @@ function add_site_navigation_menus( $menus ) {
array(
'label' => __( 'WP-CLI Commands', 'wporg' ),
'url' => '/cli/commands/',
'className' => $is_cli_home ? 'current-menu-item' : 'test',

This comment has been minimized.

Copy link
@adamwoodnz

adamwoodnz Feb 29, 2024

Contributor

Thanks for fixing this @ryelle, is the test fallback leftover debug?

This comment has been minimized.

Copy link
@ryelle

ryelle Feb 29, 2024

Author Contributor

yes… I thought I got rid of that 🤦🏻

),
),
);
Expand Down

0 comments on commit 694fe41

Please sign in to comment.