Skip to content

Commit b206116

Browse files
committed
test BeforePageDisplay hook
1 parent 6380efe commit b206116

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

LocalSettings.d/base/Skin.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@
4949
}
5050
};
5151

52+
# Hide SearchBar and New Item button for anonymous users
53+
$wgHooks['BeforePageDisplay'][] = function( $out, $skin ) {
54+
if ( !$out->getUser()->isRegistered() ) {
55+
$out->addInlineStyle( '
56+
#p-search,
57+
.p-search,
58+
#n-New-item {
59+
display: none !important;
60+
}
61+
' );
62+
}
63+
};
64+
5265
# https://github.com/ProfessionalWiki/MardiSkin
5366
wfLoadExtension( 'Bootstrap' );
5467
wfLoadSkin( 'chameleon' );

0 commit comments

Comments
 (0)