I investigated the codebase a bit and found a globalMaxDepth
option in wp-admin/js/nav-menu.js
.
When calling wpNavMenu.options.globalMaxDepth = 1
from the browser console in /wp-admin/nav-menus.php
you are no longer able to nest more than one level per drag and drop.
To achieve your goal you can now use admin_enqueue_scripts
to add a JS file to your backend which calls this code.
Hope this helps!
Related Posts:
- wp_nav_menu: show menu only if one exists, otherwise show nothing
- Unregister Nav Menu from Child-Theme
- Deleted pages are NOT removed from custom menus?
- How to add active class on current menu item page?
- Keeping parent menu items active in child pages
- Add Page ID class to nav menu items
- Way to bulk delete menu items in new 3.x Appearance > Menus system?
- Pass a parameter to a menu walker
- Menu is not visible in appearance
- WordPress nav_menu_link_attributes Not Working
- Customize the menu by adding items
- Organizing by super-categories (or nested categories)?
- Nav Menu and display post count
- Adding first and last class to Menu on top level only
- wp_nav_menu log in/out link?
- How do I get my wp_nav_menu single category page to highlight the parent?
- Accesibility problems with dropdown menus in twentyten theme or others
- Theme menu in Admin Panel
- How to target children of child pages
- How to insert custom code into wp_nav_menu structure?
- How to add custom menu item on plugin activation?
- Outside the loop, how can I echo the current page’s menu title?
- WordPress Admin Bar Covering & Overlapping Fixed Menu Header [closed]
- getting parent page id when using custom menu.
- Use menu class in walker function
- Menu link to all posts (all categories included)
- Change name & menu_name for Profile in the default menu, w/o altering core files?
- wp-menu ‘automatically add custom taxonomy terms’ like it does for pages? [closed]
- SlickNav – Google Lighthouse Accessibility issue for collapsed menu button
- Creating a navigation menu to see where you are on your website
- How I can overlap my menu in my header picture
- current-menu-item class in CSS
- Put class on instead li
- Tiles as a navigation
- Custom format nav menu only using div and a
- How to make the Primary Menu stay the same in the PC and mobile versions of the Twenty Sixteen theme
- How to add notifcations to front-end menu for users when they recieved replies?
- Page content loading issue using Walker_Nav_Menu
- Using Zurb’s Foundation Tabs as WordPress Nav (Active Tab)
- Links do not open from click, only in new tab [closed]
- Default menu editor with automatic page list
- Switch from hover to click on Twenty Twelve Menu
- a better menu, menu options assistance for WP
- Can I have custom post types in “Add menu items” on in the Admin > Appearance > Menu
- Add a custom class to nav li item
- Adding anchors in WordPress Menus
- Adding a unique ID to each sub-menu
- How to add css to single navigation text? [closed]
- WordPress custom Nav Walker
- Get parents child pages
- menu-item class missing on wordpress menu
- how to add home icon instead of text in wordpress menu
- Active class to current link
- Making pages in a menu appear conditionally
- Modify the output of wp_nav_menu in a very specific way?
- Display pictures instead of text in menus
- How to use wp_list_pages on a grandparent page
- How to add social buttons like facebook and twitter in the footer of a theme?
- WordPress Menu – creating a fake link [closed]
- How to add an archive page to WordPress menus (nav_menu)?
- Add div content to my already existing menu
- Add category label for appearance > menus items
- Custom items for Menus
- dot.com/car1 does work, but dot.com/transport/car1 doesn’t work
- Remove Double Menu in Mobile View and Have one Menu Only
- calling JS to custom menu design
- WP pages content is missing in frontend
- How to get rid of the bottom line in the navigation menu via CSS file?
- Active menu item state on all menu items
- Dashicons not showed for admin menu
- How to select particular menu position in wordpress?
- Menus not visible in Appearance after being registered
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Cannot add home page url to menu with #
- Having an issue with wp_nav_menu displaying custom navigation
- Add dynamic content block to nav section generated by custom walker
- Customizing label/title output of admin nav_menu selecter
- Extend Individual Menu on Page Function to individual Submenue on Page Function?
- Menu administration, how to allow special charachters
- How to avoid website url appending problem in wp site?
- Create custom page and custom menu
- Get first menu item of custom menu
- How can I modify wp_nav_menu with walker?
- menu items outside of blog
- Walker for menus
- Bought custom navigation menu from codecanyon, how to change feature.php?
- Custom menu linking to page not found
- How to insert date in topNav
- Change sub-menu css class
- How to add an tag when a menu item is a dropdown(or has a sub-menu) [duplicate]
- Remove “Next Post” in nav_menu
- How to display a submenu as a popup when clicking a button?
- Menu not Showing on Mobile or While the page is shrinked
- How do i add logo in wordpress studiopress (glam theme)?
- Add A Menu Item To A WP_Nav_Menu Navigation via PHP Function
- register_nav_menus and wp_nav_menu issue, not displaying independent menus
- Convert a custom bootsrap based menu to wordpress nav walker
- How do I get the menu items based on name or ID?
- Menu problem : when add wordpress element in menu it convert into empty custom link
- Problems with the navigation menu