-
Home
-
Simple Calendar – Google Calendar Plugin
- Tips
How to Hide Simple Calendar Admin Menus
function plt_hide_google_calendar_events_menus() {
//Hide "Calendars".
remove_menu_page('edit.php?post_type=calendar');
//Hide "Calendars → All Calendars".
remove_submenu_page('edit.php?post_type=calendar', 'edit.php?post_type=calendar');
//Hide "Calendars → Add New Calendar".
remove_submenu_page('edit.php?post_type=calendar', 'post-new.php?post_type=calendar');
//Hide "Calendars → Categories".
remove_submenu_page('edit.php?post_type=calendar', 'edit-tags.php?taxonomy=calendar_category&post_type=calendar');
//Hide "Calendars → Settings".
remove_submenu_page('edit.php?post_type=calendar', 'simple-calendar_settings');
//Hide "Calendars → Add-ons".
remove_submenu_page('edit.php?post_type=calendar', 'simple-calendar_add_ons');
//Hide "Calendars → Tools".
remove_submenu_page('edit.php?post_type=calendar', 'simple-calendar_tools');
}
add_action('admin_menu', 'plt_hide_google_calendar_events_menus', 11);
Where do I put this code?
How to Hide Simple Calendar Meta Boxes
function plt_hide_google_calendar_events_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Calendar Settings" meta box.
remove_meta_box('simcal-calendar-settings', $screen->id, 'normal');
//Hide the "Looking for more?" meta box.
remove_meta_box('simcal-upgrade', $screen->id, 'side');
//Hide the "Calendar Shortcode" meta box.
remove_meta_box('simcal-get-shortcode', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_google_calendar_events_metaboxes', 20);