Manual:Hooks/TitleExists

From Linux Web Expert

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

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:TitleExists extensions</tvar>.</translate>


Details

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