Open main menu

Manual:Hooks/TitleIsAlwaysKnown

< Manual:Hooks
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"
	}
}

For MediaWiki ≤1.25:

$wgHooks['TitleIsAlwaysKnown'][] = 'MyExtensionHooks::onTitleIsAlwaysKnown';
Called from:File(s): Title.php

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

DetailsEdit

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