Skip to content

Commit

Permalink
Fixed current menu item not being marked if the current URL contained…
Browse files Browse the repository at this point in the history
… a query string
  • Loading branch information
ignacionelson committed Jan 10, 2022
1 parent 0e715ae commit 863171e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions includes/main-menu.php
Expand Up @@ -345,8 +345,7 @@
/**
* Build the menu
*/
$current_filename = basename($_SERVER['REQUEST_URI']);

$current_filename = parse_url(basename($_SERVER['REQUEST_URI']));
$menu_output = "
<div class='main_side_menu'>
<ul class='main_menu' role='menu'>\n";
Expand Down Expand Up @@ -388,7 +387,7 @@
}
else
{
$sub_active = ( $subitem['link'] == $current_filename ) ? 'current_page' : '';
$sub_active = ( $subitem['link'] == $current_filename['path'] ) ? 'current_page' : '';
$format = "\t\t<li class='%s'>\n\t\t\t<a href='%s'>%s<span class='submenu_label'>%s%s</span></a>\n\t\t</li>\n";
$menu_output .= sprintf( $format, $sub_active, BASE_URI . $subitem['link'], $icon, $subitem['label'], $badge );
}
Expand Down

0 comments on commit 863171e

Please sign in to comment.