From e7109ac49894202063ddc2aa901f54f9a28bd1c9 Mon Sep 17 00:00:00 2001 From: Viljami Hirvonen Date: Wed, 16 Jun 2021 17:09:07 +0300 Subject: [PATCH 1/3] Add check for setting --- models/error404.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/error404.php b/models/error404.php index cee5e585..fe625bdb 100644 --- a/models/error404.php +++ b/models/error404.php @@ -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", From 91487f1d6c57049d82fab9d1cb0d43b41ed5dc7b Mon Sep 17 00:00:00 2001 From: Viljami Hirvonen Date: Wed, 16 Jun 2021 17:12:16 +0300 Subject: [PATCH 2/3] Fix comment style --- models/shared/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/shared/header.php b/models/shared/header.php index b5f9d095..78c6a298 100644 --- a/models/shared/header.php +++ b/models/shared/header.php @@ -207,7 +207,7 @@ public function head_custom_scripts() { return ( ! empty( $head_scripts ) ) ? $head_scripts : false; } - /* + /** * Hide search * * @return mixed From 44f9832a912ede3ae353d93513f05c68864a4f6a Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 16 Jun 2021 23:28:52 +0300 Subject: [PATCH 3/3] changelog --- CHANGELOG.MD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 32176c59..548501be 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -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