Manual:Hooks/TitleIsAlwaysKnown

From MediaWiki.org
Jump to navigation Jump to search
TitleIsAlwaysKnown
Available from version 1.20.0
Allows overriding default behaviour for determining if a page exists. If $isKnown is kept as null, regular checks happen. If it's a boolean, this value is returned by the isKnown method.
Define function:
public static function onTitleIsAlwaysKnown( $title, &$result ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"TitleIsAlwaysKnown": "MyExtensionHooks::onTitleIsAlwaysKnown"
	}
}
Called from:File(s): Title.php
Interface:TitleIsAlwaysKnownHook.php

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

Details[edit]

  • $title: Title object that is being checked
  • $result: Boolean|null; whether MediaWiki currently thinks this page is known