From ffe2a44af7dfeb16b55f8a203197d3bfc68d4787 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Sun, 4 Oct 2015 22:44:12 +0200 Subject: [PATCH] Pass the search term into the SpecialSearchResultsAppend hook Very useful to do things that need to know the actual search term (eg. to show further things related to that). The old hook supported that as well, as documented on https://www.mediawiki.org/wiki/Manual:Hooks/SpecialSearchResultsAppend That hook has been re-introduced with e7551f16 Change-Id: I7ac6ad95b29f9da0802eb3340e27b8683bf9f76d --- docs/hooks.txt | 1 + includes/specials/SpecialSearch.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 2d268b8ab3b..a36e314c1b3 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2907,6 +2907,7 @@ $term: Search term specified by the user on the search results page. Useful for including a feedback link. $specialSearch: SpecialSearch object ($this) $output: $wgOut +$term: Search term specified by the user 'SpecialSearchSetupEngine': Allows passing custom data to search engine. $search: SpecialSearch special page object diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 91e84e4decc..fc7eeb17d52 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -396,7 +396,7 @@ class SpecialSearch extends SpecialPage { $out->addHtml( "" ); - Hooks::run( 'SpecialSearchResultsAppend', array( $this, $out ) ); + Hooks::run( 'SpecialSearchResultsAppend', array( $this, $out, $term ) ); }