Manual:Hooks/MediaWikiPerformAction

From MediaWiki.org
Jump to: navigation, search
MediaWikiPerformAction
Available from version 1.12.0
Override MediaWiki::performAction().
Define function:
public static function onMediaWikiPerformAction( $output, $article, $title, $user, $request, $wiki ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"MediaWikiPerformAction": [
			"MyExtensionHooks::onMediaWikiPerformAction"
		]
	}
}

For MediaWiki ≤1.25:

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

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

Details[edit]

Use this to do something completely different, after the basic globals have been set up, but before ordinary actions take place.

Note: To prevent the standard performAction class from doing anything, return false from this hook.

See Also[edit]

  • UnknownAction hook - used for handling non-default actions specifically (after defaults have been checked)