Open main menu

Manual:Hooks/InitializeArticleMaybeRedirect

InitializeArticleMaybeRedirect
Available from version 1.13.0
Called when checking if title is a redirect.
Define function:
public static function onInitializeArticleMaybeRedirect( $title, $request, &$ignoreRedirect, &$target, $article ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"InitializeArticleMaybeRedirect": "MyExtensionHooks::onInitializeArticleMaybeRedirect"
	}
}

For MediaWiki ≤1.25:

$wgHooks['InitializeArticleMaybeRedirect'][] = 'MyExtensionHooks::onInitializeArticleMaybeRedirect';
Called from:File(s): MediaWiki.php

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

DetailsEdit

  • $title: Title object ($wgTitle )
  • $request: WebRequest
  • $ignoreRedirect: boolean to skip redirect check
  • $target: Title/string of redirect target
  • $article: GUI wrapper for the WikiPage