Jump to content

Manual:Hooks/WikiPageFactory

From mediawiki.org
WikiPageFactory
Available from version 1.28.0
Override WikiPage class used for a title
Define function:
public static function onWikiPageFactory( Title $title, WikiPage &$page ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"WikiPageFactory": "MediaWiki\\Extension\\MyExtension\\Hooks::onWikiPageFactory"
	}
}
Called from: File(s): page/WikiPage.php
Function(s): factory
Interface: WikiPageFactoryHook.php

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