-
Home
-
Simple Giveaways – Grow your business, email lists and traffic with contests
- Tips
How to Hide Simple Giveaways Admin Menus
function plt_hide_giveasap_menus() {
//Hide "Giveaways".
remove_menu_page('edit.php?post_type=giveasap');
//Hide "Giveaways → All Giveaways".
remove_submenu_page('edit.php?post_type=giveasap', 'edit.php?post_type=giveasap');
//Hide "Giveaways → Add New".
remove_submenu_page('edit.php?post_type=giveasap', 'post-new.php?post_type=giveasap');
//Hide "Giveaways → Categories".
remove_submenu_page('edit.php?post_type=giveasap', 'edit-tags.php?taxonomy=giveaway_category&post_type=giveasap');
//Hide "Giveaways → Subscribers".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap-users');
//Hide "Giveaways → Entries".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap-subscriber-entries');
//Hide "Giveaways → Settings".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap_settings');
//Hide "Giveaways → Documentation".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap_documentation');
//Hide "Giveaways → Integrations".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap_integrations');
//Hide "Giveaways → Reports".
remove_submenu_page('edit.php?post_type=giveasap', 'sg_reports');
//Hide "Giveaways → About".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap_about_page');
//Hide "Giveaways → Affiliation".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap-affiliation');
//Hide "Giveaways → Upgrade".
remove_submenu_page('edit.php?post_type=giveasap', 'giveasap-pricing');
}
add_action('admin_menu', 'plt_hide_giveasap_menus', 1000000000);
Where do I put this code?
How to Hide Simple Giveaways Meta Boxes
function plt_hide_giveasap_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Users" meta box.
remove_meta_box('giveasap_users', $screen->id, 'side');
//Hide the "Have an Idea?" meta box.
remove_meta_box('giveasap_ideas', $screen->id, 'side');
//Hide the "Giveaway" meta box.
remove_meta_box('sg-metaboxes', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_giveasap_metaboxes', 20);
How to Hide the "Simple Giveaways Overview" Dashboard Widget
function plt_hide_giveasap_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "Simple Giveaways Overview" widget.
remove_meta_box('sg-dashboard-overview', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'plt_hide_giveasap_dashboard_widgets', 20);