Below are the steps to remove/disable/hide the View History tab on Mediawiki. This works as of early 2016 on Mediawiki 1.26x. Hope it helps!
- Login to your apps/mediawiki/htdocs directory. This is the directory which contains the LocalSettings.php file.
- Edit the LocalSettings.php file (open in text editor). Add (append) the following lines
#====Begin : code to hide/remove View Source tab from Mediawiki====
function efAddSkinStyles(OutputPage &$out, Skin &$skin) {
function efAddSkinStyles(OutputPage &$out, Skin &$skin) {
if(!$skin->getUser()->isLoggedIn()) {
if ($skin->getSkinName() == 'vector') {
$out->addInlineStyle('#ca-history { display:none; }');
}
} else {
if ($skin->getSkinName() == 'vector') {
$out->addInlineStyle('#ca-view { display:none; }');
}
}
return true;
}
$wgHooks['BeforePageDisplay'][] = 'efAddSkinStyles';
#====End of code====
#====End of code====
1 comment:
Thank you so much! That did the trick, you saved me more endless hours of searching for a fix.
remote yii developers
Post a Comment