-
Home
-
RecipePress Reloaded
- Tips
How to Hide Recipepress Reloaded Admin Menus
function plt_hide_recipepress_reloaded_menus() {
//Hide "Recipes".
remove_menu_page('edit.php?post_type=rpr_recipe');
//Hide "Recipes → All Recipes".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit.php?post_type=rpr_recipe');
//Hide "Recipes → Add New Recipe".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'post-new.php?post_type=rpr_recipe');
//Hide "Recipes → Categories".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=category&post_type=rpr_recipe');
//Hide "Recipes → Tags".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=post_tag&post_type=rpr_recipe');
//Hide "Recipes → Ingredients".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=rpr_ingredient&post_type=rpr_recipe');
//Hide "Recipes → Courses".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=rpr_course&post_type=rpr_recipe');
//Hide "Recipes → Cuisines".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=rpr_cuisine&post_type=rpr_recipe');
//Hide "Recipes → Seasons".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=rpr_season&post_type=rpr_recipe');
//Hide "Recipes → Difficulties".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=rpr_difficulty&post_type=rpr_recipe');
//Hide "Recipes → Keywords".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'edit-tags.php?taxonomy=rpr_keywords&post_type=rpr_recipe');
//Hide "Recipes → Settings".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'recipepress-reloaded');
//Hide "Recipes → Extensions".
remove_submenu_page('edit.php?post_type=rpr_recipe', 'rpr_extensions');
}
add_action('admin_menu', 'plt_hide_recipepress_reloaded_menus', 11);
Where do I put this code?
How to Hide Recipepress Reloaded Meta Boxes
function plt_hide_recipepress_reloaded_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Ingredients" meta box.
remove_meta_box('rpr_ingredients_metabox', $screen->id, 'normal');
//Hide the "Instructions" meta box.
remove_meta_box('rpr_instructions_metabox', $screen->id, 'normal');
//Hide the "Notes" meta box.
remove_meta_box('rpr_notes_metabox', $screen->id, 'normal');
//Hide the "General Information" meta box.
remove_meta_box('rpr_information_metabox', $screen->id, 'side');
//Hide the "Nutrition" meta box.
remove_meta_box('rpr_nutrition_metabox', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_recipepress_reloaded_metaboxes', 20);