Skip to content

Commit

Permalink
Merge pull request #71 from devgeniem/TMS-102
Browse files Browse the repository at this point in the history
TMS-102: Add check Display Search setting
  • Loading branch information
ivuorinen authored Jun 16, 2021
2 parents 0b57250 + 44f9832 commit fa33b2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- TMS-102: Add check Display Search setting #71

## [1.3.0] - 2021-06-16

### Added
Expand Down
6 changes: 5 additions & 1 deletion models/error404.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ public function links() : array {
*
* @return array
*/
private function get_search_link() : array {
private function get_search_link() : ?array {
$home_url = $this->get_home_url();

if ( Settings::get_setting( 'hide_search' ) ) {
return null;
}

return [
'title' => _x( 'Go to search', 'theme-frontend', 'tms-theme-base' ),
'url' => "$home_url?s",
Expand Down
2 changes: 1 addition & 1 deletion models/shared/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function head_custom_scripts() {
return ( ! empty( $head_scripts ) ) ? $head_scripts : false;
}

/*
/**
* Hide search
*
* @return mixed
Expand Down

0 comments on commit fa33b2c

Please sign in to comment.