Manual:Hooks/SecondaryDataUpdates
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed from MediaWiki core in version <tvar name=ver>1.37.0</tvar> (after being deprecated in <tvar name=4>1.32.0</tvar>).</translate> <translate> Please see <tvar name=page>RevisionDataUpdates</tvar> for an alternative way to use this feature.</translate> |
SecondaryDataUpdates | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> <translate> Removed in <tvar name=1><translate> version <tvar </tvar></translate> Allows modification of the list of DataUpdates to perform when page content is modified. | |
<translate> Define function:</translate> | public static function onSecondaryDataUpdates( Title $title, Content $oldContent, bool $recursive, ParserOutput $parserOutput, &$updates ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"SecondaryDataUpdates": "MediaWiki\\Extension\\MyExtension\\Hooks::onSecondaryDataUpdates"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> content/AbstractContent.php <translate> Function(s):</translate> AbstractContent::getSecondaryDataUpdates() |
<translate> Interface:</translate> | SecondaryDataUpdatesHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:SecondaryDataUpdates extensions</tvar>.</translate>
Details
$title
: Title of the page that is being edited.$content
: Content object representing the page's content before the edit.$recursive
: bool indicating whether DataUpdates should trigger recursive updates (relevant mostly for LinksUpdate).$parserOutput
: ParserOutput representing the rendered version of the page after the edit$updates
: a list of DataUpdate objects, to be modified or replaced by the hook handler