Jump to content

Manual:Hooks/ArticleContentViewCustom

From mediawiki.org
ArticleContentViewCustom
Available from version 1.21.0
Removed in version 1.35.0 (Gerrit change 570704)
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.php
Interface: ArticleContentViewCustomHook.php

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


Details

[edit]

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