Skip to content

Instantly share code, notes, and snippets.

@jimmy89Li
Last active November 30, 2017 13:57
Show Gist options
  • Save jimmy89Li/ec2267f2f2a37a71c4ee697831b19bde to your computer and use it in GitHub Desktop.
Save jimmy89Li/ec2267f2f2a37a71c4ee697831b19bde to your computer and use it in GitHub Desktop.
Remove custom submenu pages
// You need to find out the parent menu slug, used when added the submenu:
// add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
// Replace those next
function remove_submenu() {
remove_submenu_page( '$parent_slug', '$menu_slug' );
}
add_action( 'admin_menu', 'remove_submenu', 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment