Skip to content

Instantly share code, notes, and snippets.

@michael-cannon
Created September 25, 2013 16:00
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save michael-cannon/6701832 to your computer and use it in GitHub Desktop.
Save michael-cannon/6701832 to your computer and use it in GitHub Desktop.
Remove custom post type submenu pages.
<?php
function tw_remove_menu_pages() {
// remove testimonials menu section
// remove_menu_page( 'edit.php?post_type=testimonials-widget' );
// remove categories
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=category&amp;post_type=testimonials-widget' );
// remove tags
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=post_tag&amp;post_type=testimonials-widget' );
// remove settings
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'testimonialswidget_settings' );
}
add_action( 'admin_menu', 'tw_remove_menu_pages', 999 );
?>
@Korveld
Copy link

Korveld commented Apr 11, 2020

Awesome! you're a life saver) thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment