Manual:Hooks/ShowSearchHitTitle

From MediaWiki.org
Jump to: navigation, search
ShowSearchHitTitle
Available from version 1.16.0
Customize display of search hit title/link.
Define function:
public static function onShowSearchHitTitle( Title &$title, &$titleSnippet, SearchResult $result, $terms, SpecialSearch $specialSearch, array &$query ) { ... }
Attach hook:
$wgHooks['ShowSearchHitTitle'][] = 'MyExtensionHooks::onShowSearchHitTitle';
Called from: File(s): FullSearchResultWidget.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ShowSearchHitTitle extensions.

Details[edit]

  • &$title: Title to link to
  • &$titleSnippet: Label for the link representing the search result. Typically the article title.
  • $result: The SearchResult object
  • $terms: String of the search terms entered
  • $specialSearch: The SpecialSearch object
  • &$query: Array of query string parameters for the link representing the search result.