Open main menu

Manual:Hooks/ArticleRevisionVisibilitySet

ArticleRevisionVisibilitySet
Available from version 1.13.0
Called when changing visibility of one or more revisions of an article
Define function:
public static function onArticleRevisionVisibilitySet( &$title, $ids, $visibilityChangeMap ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ArticleRevisionVisibilitySet": "MyExtensionHooks::onArticleRevisionVisibilitySet"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ArticleRevisionVisibilitySet'][] = 'MyExtensionHooks::onArticleRevisionVisibilitySet';
Called from:File(s): revisiondelete/RevDelRevisionList.php

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

DetailsEdit

  • &$title: title object of the article
  • $ids: Ids to set the visibility for
  • $visibilityChangeMap: Map of revision id to oldBits and newBits. This array can be examined to determine exactly what visibility bits have changed for each revision. This array is of the form
[id => ['oldBits' => $oldBits, 'newBits' => $newBits], ... ]