Open main menu

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": "MyExtensionHooks::onArticlePageDataAfter"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ArticlePageDataAfter'][] = 'MyExtensionHooks::onArticlePageDataAfter';
Called from:File(s): Article.php

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

DetailsEdit

  • $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.