in my effort in making the WP backend as user friendly as possible, I’m looking for a way to limit the amount of child (or submenu items) of the menu(s) under “admin > appearance > menus”. They idea is: when a theme doesn’t support a second menu level, its should also not be possible in the backend to add (drag) items to this level.
I guess to achieve this, I would have to dive in the jQuery UI library (and more specifically the jQuery sortable library).
Preferably without having to edit WP’s core.
Does anyone has any idea or experience in this?
Looking forward to your ideas.
Just use
remove_submenu_page( $menu_slug, $submenu_slug );
.$menu_slug
= Parent page$submenu_slug
= Submenu pageExample usage: