Manual:Hooks/TitleReadWhitelist

From MediaWiki.org
Jump to: navigation, search
TitleReadWhitelist
Available from version 1.19.0
Called at the end of read permissions checks, just before adding the default error message if nothing allows the user to read the page.
Define function:
public static function onTitleReadWhitelist( $title, $user, &$whitelisted ) { ... }
Attach hook:
$wgHooks['TitleReadWhitelist'][] = 'MyExtensionHooks::onTitleReadWhitelist';
Called from: File(s): Title.php

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

If a handler wants a title to not be whitelisted, it should also return false.

Details[edit]

  • $title: Title object being checked against
  • $user: Current user object
  • &$whitelisted: Boolean value of whether this title is whitelisted