Jump to content
MediaWiki

Manual:Hooks/ArticleAfterFetchContentObject

From mediawiki.org
Deprecated: This feature is deprecated and should no longer be used, however it is possibly still available for reasons of backwards compatibility . This feature was deprecated in version 1.32.0. See ArticleRevisionViewCustom for an alternative way to use this feature.
ArticleAfterFetchContentObject
Available from version 1.21.0
After fetching content of an article from the database.
Define function:
public static function onArticleAfterFetchContentObject( &$article, Content &$content = null ) { ... }
Attach hook: In extension.json:
{
"Hooks":{
"ArticleAfterFetchContentObject":"MediaWiki\\Extension\\MyExtension\\Hooks::onArticleAfterFetchContentObject"
}
}
Called from: File(s): page/Article.php
Interface: ArticleAfterFetchContentObjectHook.php

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


Details

[edit ]
  • $article: the article (object) being loaded from the database
  • &$content: the content of the article, as a Content object. Null if the user does not have access to the provided content.

Notes

[edit ]
  • Not called when loading page from cache, use ?action=purge to force page render.
  • Also called when fetching article source for action=edit.

AltStyle によって変換されたページ (->オリジナル) /