Manual:Hooks/ArticlePageDataAfter

ArticlePageDataAfter
Available from version 1.6.0
Executes after loading the data of an article from the database
Define function:
public static function onArticlePageDataAfter( $article, $row ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ArticlePageDataAfter": "MediaWiki\\Extension\\MyExtension\\Hooks::onArticlePageDataAfter"
	}
}
Called from: File(s): page/Article.php
Interface: ArticlePageDataAfterHook.php

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

Details edit

  • $article: WikiPage object
  • $row: DatabaseBase object which stores the record retrieved from page table

After MediaWiki reads page data from the database, you have an opportunity within this hook to manipulate the data fields that have been retrieved. These data fields are accessible in $row. If you need access to even more data fields from the same page database entry, you may specify these data fields from ArticlePageDataBefore.