Manual:Hooks/ArticleAfterFetchContent

Category:MediaWiki hooks#ArticleAfterFetchContent Category:Hooks added in MediaWiki 1.6.0#ArticleAfterFetchContent Category:MediaWiki deprecated or obsolete features#ArticleAfterFetchContent Category:Hooks removed in MediaWiki 1.29.0#ArticleAfterFetchContent Category:Hooks deprecated in MediaWiki 1.21.0#ArticleAfterFetchContent
ArticleAfterFetchContent
Available from version 1.6.0
Removed in version 1.29.0Category:Removed hooks#ArticleAfterFetchContent
Used to process raw wiki code after most of the other parser processing is complete.
Define function:
public static function onArticleAfterFetchContent( &$article, &$content ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ArticleAfterFetchContent": "MediaWiki\\Extension\\MyExtension\\Hooks::onArticleAfterFetchContent"
	}
}
Called from: File(s): page/Article.phpCategory:MediaWiki hooks included in Article.php#ArticleAfterFetchContent
Interface: ArticleAfterFetchContentHook.php

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

Details

  • &$article: the article object being loaded from the database
  • &$content: the content (text) of the article

Notes

  • Not called when loading page from cache, use ?action=purge to force page render.
  • Also called when fetching article source for action=edit.
Category:Hooks added in MediaWiki 1.6.0 Category:Hooks deprecated in MediaWiki 1.21.0 Category:Hooks removed in MediaWiki 1.29.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in Article.php Category:Removed hooks