Skip to content

Commit

Permalink
fix: ensure that searches are performed in the current language (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander authored Sep 4, 2020
1 parent 5bbde48 commit 4ae9ba2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/Controllers/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ public static function activeTerms($args = [])
return $unique;
}

public function homeUrl()
{
if (function_exists('pll_home_url')) {
return pll_home_url();
}

return home_url();
}

public function filterCount()
{
$count = 0;
Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/search-form.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form role="search" method="get" class="search-form @if(isset($modifier))search-form--{{ $modifier }}@endif" action="{{ home_url() }}">
<form role="search" method="get" class="search-form @if(isset($modifier))search-form--{{ $modifier }}@endif" action="{{ $home_url }}">
<label>
<span class="screen-reader-text">{{ __('Search for:', 'coop-library') }}</span>
<input type="search" class="search-field"@if(isset($placeholder)) placeholder="{{ $placeholder }}"@endif value="@if(isset($_GET['s'])){{ $_GET['s'] }}@endif" name="s">
Expand Down

0 comments on commit 4ae9ba2

Please sign in to comment.