Manual:Hooks/SearchResultProvideThumbnail
Appearance
This hook is under development and currently should be considered unstable. |
SearchResultProvideThumbnail | |
---|---|
Available from version 1.35.0 (Gerrit change 588999) This hook is called when generating search results in order to fill the thumbnail field in an extension. | |
Define function: | public static function onSearchResultProvideThumbnail( array $pageIdentities, array &$thumbnails ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"SearchResultProvideThumbnail": "MediaWiki\\Extension\\MyExtension\\Hooks::onSearchResultProvideThumbnail"
}
}
|
Called from: | File(s): Rest/Handler/SearchHandler.php Function(s): buildThumbnailsFromPageIdentities |
Interface: | SearchResultProvideThumbnailHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:SearchResultProvideThumbnail extensions.
Parameters
[edit]$pageIdentities
: Anarray
(map of strings toMediaWiki\Rest\Entity\SearchResultPageIdentity
) where key is pageId.&$thumbnails
: An outputarray
( map of strings toMediaWiki\Search\Entity\SearchResultThumbnail | null
) where key is pageId and value is either a validMediaWiki\Search\Entity\SearchResultThumbnail
for given page ornull