< Manual:Hooks
| This hook is under development and currently should be considered unstable. |
| SearchResultProvideDescription | |
|---|---|
| Available from version 1.35.0 (Gerrit change 588999) Called when generating search results in order to fill the "description" field in an extension. | |
| Define function: | public static function onSearchResultProvideDescription( array $pageIdentities, array &$descriptions ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"SearchResultProvideDescription": "MyExtensionHooks::onSearchResultProvideDescription"
}
}
|
| Called from: | File(s): Rest/Handler/SearchHandler.php Function(s): buildDescriptionsFromPageIdentities |
| Interface: | SearchResultProvideDescriptionHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:SearchResultProvideDescription extensions.
Details
- $pageIdentities: an array (
string => MediaWiki\Rest\Entity\SearchResultPageIdentity) where the key is pageId. - &$descriptions: an output array (string=>string|null) where the key is pageId and value is either a desciption for given page or null
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.