< Manual:Hooks 
 
      | CategoryViewer::generateLink | |
|---|---|
| Available from version 1.25.0 Before generating an output link allow extensions 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": "MyExtensionHooks::onCategoryViewergenerateLink"
	}
}
 | 
| Called from: | File(s): 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
- $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 of- MediaWiki\Linker\LinkRenderer->makeLink
    This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.