Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hide the plugin from the Tools menu
- add_action('admin_menu', 'hide_swift_performance_ai_menu', 999);
- function hide_swift_performance_ai_menu() {
- global $submenu;
- // Check if 'Tools' menu is set and if 'swift3' page is there, then unset it
- if (isset($submenu['tools.php'])) {
- foreach ($submenu['tools.php'] as $key => $menu_item) {
- if (strpos($menu_item[2], 'swift3') !== false) {
- unset($submenu['tools.php'][$key]);
- }
- }
- }
- }
- // Hide Swift Performance AI from the Plugins page
- add_filter('all_plugins', 'hide_swift_performance_ai_from_plugins');
- function hide_swift_performance_ai_from_plugins($plugins) {
- // Define the plugin's main file to hide
- $plugin_file = 'swift-ai/main.php';
- // Unset the plugin if it exists in the plugin list
- if (isset($plugins[$plugin_file])) {
- unset($plugins[$plugin_file]);
- }
- return $plugins;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement