Manual:Hooks/OutputPageRenderCategoryLink
Appearance
| OutputPageRenderCategoryLink | |
|---|---|
| Available from version 1.43.0 (Gerrit change 1061107) This hook is called when a category link is rendered. | |
| Define function: | public static function onOutputPageRenderCategoryLink( MediaWiki\Output\OutputPage $outputPage, MediaWiki\Page\ProperPageIdentity $categoryTitle, string $text, ?string &$link ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"OutputPageRenderCategoryLink": "MediaWiki\\Extension\\MyExtension\\Hooks::onOutputPageRenderCategoryLink"
}
}
|
| Called from: | File(s): Output/OutputPage.php, api/ApiParse.php |
| Interface: | OutputPageRenderCategoryLinkHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:OutputPageRenderCategoryLink extensions.
This hook was introduced so as to replace OutputPageMakeCategoryLinks. This is called when a category link is rendered.
Details
[edit]This hook must not abort, it must return no value.
- MediaWiki\Output\OutputPage $outputPage
- MediaWiki\Page\ProperPageIdentity $categoryTitle: Category title
- string $text: HTML escaped category name
- ?string &$link: HTML of rendered category link which can be replaced by a different HTML