Tips on Customizing LearnPress – WordPress LMS Plugin

How to Hide LearnPress Admin Menus

function plt_hide_learnpress_menus() {
	//Hide "LearnPress".
	remove_menu_page('learn_press');
	//Hide "LearnPress → Courses".
	remove_submenu_page('learn_press', 'edit.php?post_type=lp_course');
	//Hide "LearnPress → Lessons".
	remove_submenu_page('learn_press', 'edit.php?post_type=lp_lesson');
	//Hide "LearnPress → Quizzes".
	remove_submenu_page('learn_press', 'edit.php?post_type=lp_quiz');
	//Hide "LearnPress → Questions".
	remove_submenu_page('learn_press', 'edit.php?post_type=lp_question');
	//Hide "LearnPress → Orders".
	remove_submenu_page('learn_press', 'edit.php?post_type=lp_order');
	//Hide "LearnPress → Statistics".
	remove_submenu_page('learn_press', 'learn-press-statistics');
	//Hide "LearnPress → Add-ons".
	remove_submenu_page('learn_press', 'learn-press-addons');
	//Hide "LearnPress → Settings".
	remove_submenu_page('learn_press', 'learn-press-settings');
	//Hide "LearnPress → Tools".
	remove_submenu_page('learn_press', 'learn-press-tools');
}

add_action('admin_menu', 'plt_hide_learnpress_menus', 11);

Where do I put this code?

How to Hide LearnPress Meta Boxes

function plt_hide_learnpress_metaboxes() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Hide the "" meta box.
	remove_meta_box('fake_metabox', $screen->id, 'normal');
	//Hide the "Lesson Settings" meta box.
	remove_meta_box('lesson_settings', $screen->id, 'normal');
	//Hide the "General Settings" meta box.
	remove_meta_box('general-settings', $screen->id, 'normal');
	//Hide the "Settings" meta box.
	remove_meta_box('question_settings', $screen->id, 'normal');
}

add_action('add_meta_boxes', 'plt_hide_learnpress_metaboxes', 20);

How to Hide LearnPress Dashboard Widgets

function plt_hide_learnpress_dashboard_widgets() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Remove the "LearnPress order status" widget.
	remove_meta_box('learn_press_dashboard_order_statuses', 'dashboard', 'normal');
	//Remove the "LearnPress status" widget.
	remove_meta_box('learn_press_dashboard_plugin_status', 'dashboard', 'normal');
}

add_action('wp_dashboard_setup', 'plt_hide_learnpress_dashboard_widgets', 20);