Open main menu

Manual:Hooks/NewPagesLineEnding

NewPagesLineEnding
Available from version 1.30.0 (Gerrit change 336963)
Called before an HTML line for Special:NewPages is finished.
Define function:
public static function onNewPagesLineEnding( SpecialNewpages $page, string &$line, $row, array &$classes, array &$attribs ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"NewPagesLineEnding": "MyExtensionHooks::onNewPagesLineEnding"
	}
}

For MediaWiki ≤1.25:

$wgHooks['NewPagesLineEnding'][] = 'MyExtensionHooks::onNewPagesLineEnding';
Called from:File(s): specials/SpecialNewpages.php
Function(s): formatRow

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

DetailsEdit

  • $page: the SpecialNewpages object
  • &$line: the HTML string representing this line
  • $row: the database row for this page (the recentchanges record and a few extras - see NewPagesPager::getQueryInfo)
  • &$classes: array of CSS classes to add to the surrounding line wrapper
  • &$attribs: associative array of other HTML attributes for the surrounding line wrapper. Currently only data attributes reserved to MediaWiki are allowed (see Sanitizer::isReservedDataAttribute).

See alsoEdit