Manual:Hooks/MediaWikiPerformAction

From MediaWiki.org

Jump to: navigation, search
MediaWikiPerformAction
Available from version 1.12.0
Override MediaWiki::performAction().

*Define function:
function fnMyHook( $output, $article, $title, $user, $request, $wiki ) { ... }

*Attach hook:
$wgHooks['MediaWikiPerformAction'][] = 'fnMyHook';
Called from: Wiki.php

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


[edit] Details

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

  • $output: $wgOut
  • $article: $wgArticle
  • $title: $wgTitle
  • $user: $wgUser
  • $request: $wgRequest
  • $wiki: MediaWiki object, added in 1.13

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

[edit] See Also

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