Manual:Hooks/SpecialContributionsBeforeMainOutput

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
SpecialContributionsBeforeMainOutput
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Before the form on Special:Contributions
<translate> Define function:</translate>
public static function onSpecialContributionsBeforeMainOutput( int $id, User $user, SpecialPage $special ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"SpecialContributionsBeforeMainOutput": "MediaWiki\\Extension\\MyExtension\\Hooks::onSpecialContributionsBeforeMainOutput"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> SpecialContributions.php
<translate> Interface:</translate> SpecialContributionsBeforeMainOutputHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:SpecialContributionsBeforeMainOutput extensions</tvar>.</translate>

Details

  • $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)
Since 1.16, the return value is checked, returning false will stop normal output (bug 22051).