Manual:Hooks/PageHistoryBeforeList

From MediaWiki.org
Jump to navigation Jump to search
PageHistoryBeforeList
Available from version 1.10.0
When a history page list is about to be constructed.
Define function:
public static function onPageHistoryBeforeList( Page $article, IContextSource $context ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"PageHistoryBeforeList": "MyExtensionHooks::onPageHistoryBeforeList"
	}
}

For MediaWiki ≤1.25:

$wgHooks['PageHistoryBeforeList'][] = 'MyExtensionHooks::onPageHistoryBeforeList';
Called from:File(s): actions/HistoryAction.php
Function(s): onView

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

Details[edit]

  • $article: A Page instance, the article that the history is loading for
  • $context: IContextSource instance (introduced in 1.21) (Gerrit change 53603)