Skip to content

Commit 60e5008

Browse files
authored
hide litespeed admin page for non superadmins (#94)
1 parent 3c187a4 commit 60e5008

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Admin/Admin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public static function hooks(): void {
2727

2828
// Maybe remove ACF from admin.
2929
add_filter( 'acf/settings/show_admin', [ self::class, 'maybe_show_acf' ] );
30+
31+
add_action( 'admin_init', [ self::class, 'maybe_hide_litespeed' ] );
3032
}
3133

3234
/**
@@ -94,4 +96,12 @@ function a() {
9496
public static function maybe_show_acf(): bool {
9597
return 'production' !== wp_get_environment_type();
9698
}
99+
100+
public static function maybe_hide_litespeed() {
101+
if( is_multisite() ){
102+
if( ! current_user_can('setup_network')){ // is not superadmin
103+
remove_menu_page( 'litespeed' );
104+
}
105+
}
106+
}
97107
}

0 commit comments

Comments
 (0)