996 B
996 B
- Since: 3.1
- Description: Hook allows to forcibly change a revision used during content parsing as in case of the
UpdateJobexecution or when runningrebuildData.php. - Reference class:
RevisionGuard.php
If you do alter a revision, please log the event and make it visible to a user (or administrator) that it was changed.
Signature
use MediaWiki\MediaWikiServices;
MediaWikiServices::getInstance()->getHookContainer()->register( 'SMW::RevisionGuard::ChangeRevision', function( $title, &$revision ) {
// Set a revision
// $revisionLookup = \MediaWiki\MediaWikiServices::getInstance()->getRevisionLookup();
// $revision = $revisionLookup->getRevisionById( $id );
return true;
} );
See also
- See the
SemanticApprovedRevsextension for how to use the hook