-
Home
-
Weather Station
- Tips
How to Hide Weather Station Admin Menus
function plt_hide_live_weather_station_menus() {
//Hide "Weather Station".
remove_menu_page('lws-dashboard');
//Hide "Weather Station → Dashboard".
remove_submenu_page('lws-dashboard', 'lws-dashboard');
//Hide "Weather Station → Stations".
remove_submenu_page('lws-dashboard', 'lws-stations');
//Hide "Weather Station → Maps".
remove_submenu_page('lws-dashboard', 'lws-maps');
//Hide "Weather Station → Events".
remove_submenu_page('lws-dashboard', 'lws-events');
//Hide "Weather Station → Settings".
remove_submenu_page('lws-dashboard', 'lws-settings');
}
add_action('admin_menu', 'plt_hide_live_weather_station_menus', 11);
Where do I put this code?
How to Hide the "Weather Station 3" Dashboard Widget
function plt_hide_live_weather_station_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "Weather Station 3" widget.
remove_meta_box('lws_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'plt_hide_live_weather_station_dashboard_widgets', 20);