Manual:Hooks/WatchlistEditorBeforeFormRender

From MediaWiki.org
Jump to navigation Jump to search
WatchlistEditorBeforeFormRender
Available from version 1.24.0 (Gerrit change 156119)
Occurs before building the Special:EditWatchlist form, used to manipulate the list of pages or preload data based on that list.
Define function:
public static function onWatchlistEditorBeforeFormRender( array &$watchlistInfo ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"WatchlistEditorBeforeFormRender": "MyExtensionHooks::onWatchlistEditorBeforeFormRender"
	}
}

For MediaWiki ≤1.25:

$wgHooks['WatchlistEditorBeforeFormRender'][] = 'MyExtensionHooks::onWatchlistEditorBeforeFormRender';
Called from:File(s): specials/SpecialEditWatchlist.php
Function(s): getNormalForm

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

Details[edit]

  • &$watchlistInfo: array of watch-listed pages in [namespaceId => ['title1' => 1, 'title2' => 1]] format