Jump to content

Manual:Hooks/ParserCacheSaveComplete

From mediawiki.org
ParserCacheSaveComplete
Available from version 1.26.0
Modify ParserOutput safely after it has been saved to cache.
Define function:
public static function onParserCacheSaveComplete( ParserCache $parserCache, ParserOutput $parserOutput, Title $title, ParserOptions $parserOptions, int $revId ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ParserCacheSaveComplete": "MediaWiki\\Extension\\MyExtension\\Hooks::onParserCacheSaveComplete"
	}
}
Called from: File(s): parser/ParserCache.php
Function(s): save
Interface: ParserCacheSaveCompleteHook.php

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


Parameters

[edit]
  • $parserCache: ParserCache object that $parserOutput was stored in
  • $parserOutput: ParserOutput object that was stored
  • $title: Title of the page that was parsed to generate $parserOutput
  • $popts: ParserOptions used for generating $parserOutput
  • $revId: An int representing the ID of the revision that was parsed to create $parserOutput