Manual:Hooks/SpecialPageBeforeExecute

From MediaWiki.org
Jump to navigation Jump to search
SpecialPageBeforeExecute
Available from version 1.20.0
Called before SpecialPage::execute().
Define function:
public static function onSpecialPageBeforeExecute( $special, $subPage ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SpecialPageBeforeExecute": "MyExtensionHooks::onSpecialPageBeforeExecute"
	}
}

For MediaWiki ≤1.25:

$wgHooks['SpecialPageBeforeExecute'][] = 'MyExtensionHooks::onSpecialPageBeforeExecute';
Called from: File(s): SpecialPage.php

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

Details[edit]

  • $special: the SpecialPage object
  • $subPage: the subpage string or null if no subpage was specified