Jump to content

Manual:Hooks/InitializeArticleMaybeRedirect

From mediawiki.org
InitializeArticleMaybeRedirect
Available from version 1.13.0 (r37035, codereview)
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": "MediaWiki\\Extension\\MyExtension\\Hooks::onInitializeArticleMaybeRedirect"
	}
}
Called from: File(s): MediaWiki.php
Interface: InitializeArticleMaybeRedirectHook.php

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

Details

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