Manual:Hooks/WikiPageFactory

From MediaWiki.org
Jump to navigation Jump to search
WikiPageFactory
Available from version ???
Override WikiPage class used for a title
Define function:
public static function onWikiPageFactory( Title $title, WikiPage &$page ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"WikiPageFactory": "MyExtensionHooks::onWikiPageFactory"
	}
}

For MediaWiki ≤1.25:

$wgHooks['WikiPageFactory'][] = 'MyExtensionHooks::onWikiPageFactory';
Called from:File(s): WikiPage.php
Function(s): factory

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