-
Home
-
TreePress – Easy Family Trees & Ancestor Profiles
- Tips
How to Hide TreePress Admin Menus
function plt_hide_treepress_menus() {
//Hide "TreePress".
remove_menu_page('treepress');
//Hide "TreePress → All Charts".
remove_submenu_page('treepress', 'edit.php?post_type=chart');
//Hide "TreePress → Add Chart".
remove_submenu_page('treepress', 'post-new.php?post_type=chart');
//Hide "TreePress → All Members".
remove_submenu_page('treepress', 'edit.php?post_type=member');
//Hide "TreePress → Add Member".
remove_submenu_page('treepress', 'post-new.php?post_type=member');
//Hide "TreePress → All Families".
remove_submenu_page('treepress', 'edit.php?post_type=family');
//Hide "TreePress → Add Family".
remove_submenu_page('treepress', 'post-new.php?post_type=family');
//Hide "TreePress → Family Groups".
remove_submenu_page('treepress', 'edit-tags.php?taxonomy=family-group&post_type=member');
//Hide "TreePress → Options".
remove_submenu_page('treepress', 'treepress-options');
//Hide "TreePress → Account Settings".
remove_submenu_page('treepress', 'treepress-account-settings');
//Hide "TreePress → Affiliation".
remove_submenu_page('treepress', 'treepress-account-settings-affiliation');
//Hide "TreePress → Contact Us".
remove_submenu_page('treepress', 'treepress-account-settings-contact');
//Hide "TreePress → Support Forum".
remove_submenu_page('treepress', 'treepress-account-settings-wp-support-forum');
//Hide "TreePress → Add-Ons".
remove_submenu_page('treepress', 'treepress-account-settings-addons');
//Hide "TreePress → Upgrade".
remove_submenu_page('treepress', 'treepress-account-settings-pricing');
}
add_action('admin_menu', 'plt_hide_treepress_menus', 1000000000);
Where do I put this code?
How to Hide TreePress Meta Boxes
function plt_hide_treepress_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Member info" meta box.
remove_meta_box('treepress_member_info', $screen->id, 'advanced');
//Hide the "Family info" meta box.
remove_meta_box('treepress_family_info', $screen->id, 'advanced');
//Hide the "Chart Settings" meta box.
remove_meta_box('treepress_chart_setting', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_treepress_metaboxes', 20);