Manual:Hooks/ArticlePageDataBefore

From MediaWiki.org

Jump to: navigation, search
ArticlePageDataBefore
Available from version 1.6.0
Executes before data is loaded for the article requested

*Define function:
function fnMyHook( $article, $fields ) { ... }

*Attach hook:
$wgHooks['ArticlePageDataBefore'][] = 'fnMyHook';
Called from: Article.php

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


[edit] Details

  • $article: Article object being requested
  • $fields: fields to load from the database

As mediawiki reads in the page data, this hook allows you to read more data fields related to the same database row. You specify more data fields by adding them to $fields parameter. Such data fields can then be manipulated from ArticlePageDataAfter.