Manual:Hooks/CategoryViewer::generateLink
Appearance
Deprecated: This feature is deprecated and should no longer be used, however it is possibly still available for reasons of backwards compatibility. This feature was deprecated in version 1.47.0. See CategoryViewerGenerateLink for an alternative way to use this feature. |
| CategoryViewer::generateLink | |
|---|---|
| Available from version 1.25.0 Before generating an output link, allow extensions the opportunity to generate a more specific or relevant link. | |
| Define function: | public static function onCategoryViewer_generateLink( string $type, Title $title, ?string $html, string &$link ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"CategoryViewer::generateLink": "MediaWiki\\Extension\\MyExtension\\Hooks::onCategoryViewergenerateLink"
}
}
|
| Called from: | File(s): Category/CategoryViewer.php Function(s): generateLink |
| Interface: | CategoryViewer__generateLinkHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:CategoryViewer::generateLink extensions.
Details
[edit]$type: The category type. Either 'page', 'img', or 'subcat'$title: Title object for the categorized page$html: Requested HTML content of anchor&$link: Returned value. When set to a non-null value by a hook subscriber, this value will be used as the anchor instead ofMediaWiki\Linker\LinkRenderer->makeLink