Jump to content

Manual:Hooks/SpecialPageExecuteBeforeHeader

From mediawiki.org
SpecialPageExecuteBeforeHeader
Available from version 1.6.0
Removed in version 1.14.0
called before setting the header text of the special page
Define function:
public static function onSpecialPageExecuteBeforeHeader( $specialPage, $par, $funct ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"SpecialPageExecuteBeforeHeader": "MediaWiki\\Extension\\MyExtension\\Hooks::onSpecialPageExecuteBeforeHeader"
	}
}
Called from: File(s): SpecialPage.php
Interface: SpecialPageExecuteBeforeHeaderHook.php

For more information about attaching hooks, see Manual:Hooks .

Details

[edit]
  • $specialPage: SpecialPage object
  • $par: paramter passed to the special page (string)
  • $funct: function called to execute the special page

Usage

[edit]

There is a note in includes/SpecialPage.php where this hook is called stating that it is broken for extensions:

# FIXME: these hooks are broken for extensions and anything else that subclasses SpecialPage. 

This is due to the fact that extensions that subclass SpecialPage implement their own execute function. Since the hooks are fired in the SpecialPage parent class execute function they don't get called in the subclass. A bug has been filed for this, but the chances of it being fixed in the short term are probably small due to this subclass/parentclass problem.