Jump to content

Manual:Hooks/TitleExists

From mediawiki.org
TitleExists
Available from version 1.24.0 (Gerrit change 160546)
Called when determining whether a page exists at a given title.
Define function:
public static function onTitleExists( Title $title, bool &$exists ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"TitleExists": "MediaWiki\\Extension\\MyExtension\\Hooks::onTitleExists"
	}
}
Called from: File(s): Title.php
Function(s): exists
Interface: TitleExistsHook.php

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


Details

[edit]
  • $title: The title being tested.
  • &$exists: A boolean; whether the title exists.