Skip to content

Commit

Permalink
Fix search fiter type key warning. (#41630)
Browse files Browse the repository at this point in the history
* Added a safeguard for nonexistent array offset warning.

* Changelog.
  • Loading branch information
zinigor authored Feb 7, 2025
1 parent bb45a1a commit 1ca4244
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Added a safeguard for unset array item warnings.


2 changes: 1 addition & 1 deletion projects/packages/search/src/class-template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function render_available_filters( $filters = null, $post_types =
}

foreach ( (array) $filters as $filter ) {
if ( 'post_type' === $filter['type'] ) {
if ( isset( $filter['type'] ) && 'post_type' === $filter['type'] ) {
self::render_filter( $filter, $post_types );
} else {
self::render_filter( $filter, $active_post_types );
Expand Down

0 comments on commit 1ca4244

Please sign in to comment.