Skip to content

Commit b371a0e

Browse files
authored
Merge pull request #24 from humanmade/backport-23-to-v24-branch
[Backport v24-branch] Remove dashboard pages.
2 parents 18b2222 + 5b44fa4 commit b371a0e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

inc/namespace.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ function bootstrap() {
1919
define( 'PS_DISABLE_MU', true );
2020
add_action( 'plugins_loaded', __NAMESPACE__ . '\\on_plugins_loaded', 1 );
2121
add_action( 'mu_plugins_loaded', __NAMESPACE__ . '\\on_mu_plugins_loaded', 1 );
22+
add_action( 'admin_menu', __NAMESPACE__ . '\\remove_options_page', 99 );
23+
add_action( 'network_admin_menu', __NAMESPACE__ . '\\remove_network_page', 99 );
2224
}
2325

2426
/**
@@ -91,3 +93,21 @@ function on_mu_plugins_loaded() {
9193
}
9294
}
9395
}
96+
97+
/**
98+
* Remove the options page from the Settings menu.
99+
*
100+
* @return void
101+
*/
102+
function remove_options_page() {
103+
remove_submenu_page( 'options-general.php', 'patchstack' );
104+
}
105+
106+
/**
107+
* Remove the network admin menu.
108+
*
109+
* @return void
110+
*/
111+
function remove_network_page() {
112+
remove_menu_page( 'patchstack-multisite' );
113+
}

0 commit comments

Comments
 (0)