Open main menu

Manual:Hooks/CategoryAfterPageAdded

< Manual:Hooks
CategoryAfterPageAdded
Available from version 1.21.0 (Gerrit change 52295)
Called after a page is added to a category
Define function:
public static function onCategoryAfterPageAdded( $category, $wikiPage ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"CategoryAfterPageAdded": "MyExtensionHooks::onCategoryAfterPageAdded"
	}
}

For MediaWiki ≤1.25:

$wgHooks['CategoryAfterPageAdded'][] = 'MyExtensionHooks::onCategoryAfterPageAdded';
Called from:File(s): WikiPage.php

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

DetailsEdit

  • $category: Category that page was added to
  • $wikiPage: WikiPage that was added

See alsoEdit