Manual:Hooks/OutputPageMakeCategoryLinks

Category:MediaWiki hooks#OutputPageMakeCategoryLinks Category:Hooks added in MediaWiki 1.13.0#OutputPageMakeCategoryLinks Category:MediaWiki deprecated or obsolete features#OutputPageMakeCategoryLinks Category:Hooks removed in MediaWiki 1.44.0#OutputPageMakeCategoryLinks Category:Hooks deprecated in MediaWiki 1.43.0#OutputPageMakeCategoryLinks
OutputPageMakeCategoryLinks
Available from version 1.13.0 (r36944, CodeReview archive)
Removed in version 1.44.0 (Gerrit change 1069118)Category:Removed hooks#OutputPageMakeCategoryLinks
Called when links are about to be generated for the page's categories.
Define function:
public static function onOutputPageMakeCategoryLinks( &$out, $categories, &$links ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"OutputPageMakeCategoryLinks": "MediaWiki\\Extension\\MyExtension\\Hooks::onOutputPageMakeCategoryLinks"
	}
}
Called from: File(s): Output/OutputPage.phpCategory:MediaWiki hooks included in OutputPage.php#OutputPageMakeCategoryLinks
Interface: OutputPageMakeCategoryLinksHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:OutputPageMakeCategoryLinks extensions.

Details

Implementations should return false if they generate the category links, so the default link generation is skipped.

  • &$out: OutputPage instance (object)
  • $categories: associative array, keys are category names, values are category types ("normal" or "hidden")
  • &$links: array, intended to hold the result. Must be an associative array with category types as keys and arrays of HTML links as values.
Category:Category hooks
Category:Category hooks Category:Hooks added in MediaWiki 1.13.0 Category:Hooks deprecated in MediaWiki 1.43.0 Category:Hooks removed in MediaWiki 1.44.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in OutputPage.php Category:Removed hooks