Manual:Hooks/ArticleContentViewCustom

Category:MediaWiki hooks#ArticleContentViewCustom Category:Hooks added in MediaWiki 1.21.0#ArticleContentViewCustom Category:MediaWiki deprecated or obsolete features#ArticleContentViewCustom Category:Hooks removed in MediaWiki 1.35.0#ArticleContentViewCustom Category:Hooks deprecated in MediaWiki 1.32.0#ArticleContentViewCustom
ArticleContentViewCustom
Available from version 1.21.0
Removed in version 1.35.0 (Gerrit change 570704)Category:Removed hooks#ArticleContentViewCustom
allows to output the text of the article in a different format than wikitext
Define function:
public static function onArticleContentViewCustom( $content, $title, $output ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ArticleContentViewCustom": "MediaWiki\\Extension\\MyExtension\\Hooks::onArticleContentViewCustom"
	}
}
Called from: File(s): page/Article.phpCategory:MediaWiki hooks included in Article.php#ArticleContentViewCustom
Interface: ArticleContentViewCustomHook.php

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

Details

Allows to output the text of the article in a different format than wikitext. Note that it is preferable to implement proper handing for a custom data type using the ContentHandler facility.

  • $content: content of the page, as a Content object
  • $title: title of the page
  • $output: reference to $wgOut
Category:Hooks added in MediaWiki 1.21.0 Category:Hooks deprecated in MediaWiki 1.32.0 Category:Hooks removed in MediaWiki 1.35.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in Article.php Category:Removed hooks