< Manual:Hooks
ArticleRevisionViewCustom
Available from version 1.32.0
allows to output the text of an article revision in a different format than wikitext
Define function:
public static function onArticleRevisionViewCustom( $revision, $title, $oldId, $output ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ArticleRevisionViewCustom": "MyExtensionHooks::onArticleRevisionViewCustom"
	}
}
Called from: File(s): page/Article.php, diff/DifferenceEngine.php
Interface: ArticleRevisionViewCustomHook.php

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

Details

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

  • $revision: revision of the page, as a MediaWiki\Revision\RevisionRecord object (or null if the revision could not be loaded). This may also be a fake revision that wraps content supplied by an extension.
  • $title: the page, as a Title object
  • $oldId: the requested revision ID, or 0 for the current revision
  • $output: An instance of OutputPage

This hook replaces the ArticleAfterFetchContentObject hook.

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.