Skip to content

Commit c03ac21

Browse files
author
Miika Arponen
authored
Merge pull request #163 from jmaekki/archive-current-menu-item
Fix current menu item check on archive pages
2 parents f1a37f9 + 4709962 commit c03ac21

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9-
109
## [Released]
1110

11+
## [1.34.4] - 2021-10-14
12+
13+
### Fixed
14+
- Fix current menu item check on archive pages.
15+
1216
## [1.34.3] - 2021-09-30
13-
- Pagination parameter page_count didn't always return the right value. This update will fix it.
17+
18+
### Fixed
19+
- Pagination parameter page_count didn't always return the right value.
1420

1521
## [1.34.2] - 2021-08-09
1622

@@ -22,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2228
### Fixed
2329
- Fix archive pages for custom taxonomies when filtering with another taxonomy.
2430
- Fix a variable typo
31+
2532
## [1.34.0] - 2021-06-10
2633

2734
### Changed

helpers/menu.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ private static function is_current( $item, $override ) {
292292
$return = ( $item->object_id == $term_id && 'taxonomy' == $item->type )
293293
|| ( $item->object_id == $override );
294294
}
295+
elseif ( \is_archive() ) {
296+
$return = ( 'post_type_archive' == $item->type && \is_post_type_archive( $item->object ) )
297+
|| ( $item->object_id == $override );
298+
}
295299
else {
296300
$return = ( \get_the_ID() == $item->object_id
297301
&& 'post_type' == $item->type )

0 commit comments

Comments
 (0)