Open main menu

Manual:Hooks/SpecialContributionsBeforeMainOutput

SpecialContributionsBeforeMainOutput
Available from version 1.5.0
Before the form on Special:Contributions
Define function:
public static function onSpecialContributionsBeforeMainOutput( int $id, User $user, SpecialPage $special ) { ... }
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.

DetailsEdit

  • $id: User ID number, only provided for backwards-compatability
  • $user: User object contributions are being fetched for (1.23+, added in Gerrit change 103090)
  • $special: SpecialPage instance, provides context (1.23+, added in Gerrit change 103090)

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