$terms: String of the search terms entered
$specialSearch: The SpecialSearch object
&$query: Array of query string parameters for the link representing the search result.
+&$attributes: Array of title link attributes, can be modified by extension.
'SidebarBeforeOutput': Allows to edit sidebar just before it is output by skins.
Warning: This hook is run on each display. You should consider to use
$title = clone $result->getTitle();
$query = [];
+ $attributes = [ 'data-serp-pos' => $position ];
Hooks::run( 'ShowSearchHitTitle',
- [ &$title, &$snippet, $result, $terms, $this->specialPage, &$query ] );
+ [ &$title, &$snippet, $result, $terms, $this->specialPage, &$query, &$attributes ] );
$link = $this->linkRenderer->makeLink(
$title,
$snippet,
- [ 'data-serp-pos' => $position ],
+ $attributes,
$query
);