Manual:Hooks/CategoryAfterPageAdded

From MediaWiki.org
Jump to navigation Jump to search
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"
	}
}
Called from:File(s): page/WikiPage.php
Interface:CategoryAfterPageAddedHook.php

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

Details[edit]

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

See also[edit]