Manual:Hooks/SpecialPageExecuteBeforePage

From Linux Web Expert

SpecialPageExecuteBeforePage
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar </tvar></translate>
Called before setting the page text of the special page
<translate> Define function:</translate>
public static function onSpecialPageExecuteBeforePage( $specialpage, $parameters, $function ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"SpecialPageExecuteBeforePage": "MediaWiki\\Extension\\MyExtension\\Hooks::onSpecialPageExecuteBeforePage"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> SpecialPage.php
<translate> Interface:</translate> SpecialPageExecuteBeforePageHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>

Details

  • $specialpage: The SpecialPage being executed
  • $parameters: Any parameter passed to the page (i.e. /wiki/index.php/SpecialAllpages/Foo. Foo is the parameter)
  • $function: The function called to execute the special page (??)