-
Home
-
Leyka
- Tips
How to Hide Leyka Admin Menus
function plt_hide_leyka_menus() {
//Hide "Leyka".
remove_menu_page('leyka');
//Hide "Leyka → Dashboard".
remove_submenu_page('leyka', 'leyka');
//Hide "Leyka → Campaigns".
remove_submenu_page('leyka', 'edit.php?post_type=leyka_campaign');
//Hide "Leyka → Donations".
remove_submenu_page('leyka', 'leyka_donations');
//Hide "Leyka → Recurring subscriptions".
remove_submenu_page('leyka', 'leyka_recurring_subscriptions');
//Hide "Leyka → Settings".
remove_submenu_page('leyka', 'leyka_settings');
//Hide "Leyka → Help".
remove_submenu_page('leyka', 'leyka_help');
}
add_action('admin_menu', 'plt_hide_leyka_menus', 11);
Where do I put this code?
How to Hide Leyka Meta Boxes
function plt_hide_leyka_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Donation status" meta box.
remove_meta_box('leyka_donation_status', $screen->id, 'side');
//Hide the "New donation data" meta box.
remove_meta_box('leyka_donation_new_data', $screen->id, 'normal');
//Hide the "Annotation" meta box.
remove_meta_box('leyka_campaign_excerpt', $screen->id, 'normal');
//Hide the "Campaign settings" meta box.
remove_meta_box('leyka_campaign_data', $screen->id, 'normal');
//Hide the "Payments amounts campaign form fields" meta box.
remove_meta_box('leyka_campaign_payments_amounts', $screen->id, 'normal');
//Hide the "Additional campaign form fields" meta box.
remove_meta_box('leyka_campaign_additional_fields', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_leyka_metaboxes', 20);