1<?php
2
3function by_remove_menu_pages() {
4 // remove testimonials menu section
5 // remove_menu_page( 'edit.php?post_type=testimonials-widget' );
6 // remove categories
7 remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=category&post_type=testimonials-widget' );
8 // remove tags
9 remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=post_tag&post_type=testimonials-widget' );
10 // remove settings
11 remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'testimonialswidget_settings' );
12}
13
14add_action( 'admin_menu', 'by_remove_menu_pages', 999 );