Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix current menu item check on archive pages #163

Merged
merged 2 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]


## [Released]

## [1.34.4] - 2021-10-14

### Fixed
- Fix current menu item check on archive pages.

## [1.34.3] - 2021-09-30
- Pagination parameter page_count didn't always return the right value. This update will fix it.

### Fixed
- Pagination parameter page_count didn't always return the right value.

## [1.34.2] - 2021-08-09

Expand All @@ -22,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Fix archive pages for custom taxonomies when filtering with another taxonomy.
- Fix a variable typo

## [1.34.0] - 2021-06-10

### Changed
Expand Down
4 changes: 4 additions & 0 deletions helpers/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ private static function is_current( $item, $override ) {
$return = ( $item->object_id == $term_id && 'taxonomy' == $item->type )
|| ( $item->object_id == $override );
}
elseif ( \is_archive() ) {
$return = ( 'post_type_archive' == $item->type && \is_post_type_archive( $item->object ) )
|| ( $item->object_id == $override );
}
else {
$return = ( \get_the_ID() == $item->object_id
&& 'post_type' == $item->type )
Expand Down