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( MediaWiki\Pager\NewPagesPager $page, string &$line, $row, array &$classes, array &$attribs ) { ... }
Attach hook: In extension.json:
	"Hooks": {
		"NewPagesLineEnding": "MediaWiki\\Extension\\MyExtension\\Hooks::onNewPagesLineEnding"
Called from: File(s): specials/SpecialNewpages.php
Function(s): formatRow
Interface: NewPagesLineEndingHook.php

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

Details edit

  • $page: the MediaWiki\Pager\NewPagesPager object (introduced in 1.41). Before, this took an instance of SpecialNewpages.
  • &$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 also edit