Manual:Hooks/ArticleViewCustom

From MediaWiki.org
Jump to navigation Jump to search
ArticleViewCustom
Available from version 1.19.0 (r94259)
Removed in version 1.29.0
allows to output the text of the article in a different format than wikitext
Define function:
public static function onArticleViewCustom( $text, $title, $output ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ArticleViewCustom": "MyExtensionHooks::onArticleViewCustom"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ArticleViewCustom'][] = 'MyExtensionHooks::onArticleViewCustom';
Called from:File(s): Article.php

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

Details[edit]

Allows to output the text of the article in a different format than wikitext.

  • $text: text of the page
  • $title: title of the page
  • $output: reference to $wgOut

Notes[edit]

This hook has been marked as deprecated in version 1.21; use ArticleContentViewCustom instead. Note that it is preferable to implement proper handing for a custom data type using the ContentHandler facility.