wp_nav_menu_max_depth() WordPress Function
The wp_nav_menu_max_depth() function allows you to set the maximum depth for a navigation menu. This can be useful if you want to create a nested menu structure but don't want it to go too deep. The default value for this function is 0, which means there is no maximum depth.
wp_nav_menu_max_depth( string $classes ) #
Contents
Parameters
- $classes
(string)(Required)
Return
(string)
Source
File: wp-admin/nav-menus.php
function wp_nav_menu_max_depth( $classes ) {
global $_wp_nav_menu_max_depth;
return "$classes menu-max-depth-$_wp_nav_menu_max_depth";
}
Expand full source codeCollapse full source codeView on TracView on GitHub