Manual:Hooks/SpecialContributionsBeforeMainOutput

From MediaWiki.org
Jump to: navigation, search
SpecialContributionsBeforeMainOutput
Available from version 1.5.0
Before the form on Special:Contributions
Define function:
public static function onSpecialContributionsBeforeMainOutput( $id, User $user, SpecialPage $sp ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SpecialContributionsBeforeMainOutput": "MyExtensionHooks::onSpecialContributionsBeforeMainOutput"
	}
}

For MediaWiki ≤1.25:

$wgHooks['SpecialContributionsBeforeMainOutput'][] = 'MyExtensionHooks::onSpecialContributionsBeforeMainOutput';
Called from: File(s): SpecialContributions.php

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

Details[edit]

  • $id: User id number, only provided for backwards-compatability
  • $user: User object contributions are being fetched for (since 1.23, added in gerrit:103090)
  • $sp: SpecialPage instance, provides context (since 1.23, added in gerrit:103090)

Note Note: Since 1.16, the return value is checked, returning false will stop normal output (bug 22051).