[wp-trac] [WordPress Trac] #57160: Problem nav-menu-template.php
WordPress Trac
noreply at wordpress.org
Mon Nov 21 11:13:07 UTC 2022
#57160: Problem nav-menu-template.php
--------------------------+-----------------------------
Reporter: userbleona | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.1.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Hello,
In my web show the statement** Notice: Undefined offset: 6994 in
/home3/xiddjsgr/public_html/dekra/wp-includes/nav-menu-template.php on
line 211**, and the code on line 211 is:
''// Calculate the depth of each menu item with children.
foreach ( $menu_items_with_children as $menu_item_key =>
&$menu_item_depth ) {
$menu_item_parent = $menu_items_tree[ $menu_item_key ];
while ( $menu_item_parent ) {
$menu_item_depth = $menu_item_depth + 1;
$menu_item_parent = $menu_items_tree[
$menu_item_parent ];
}
}
// Add the menu-item-has-children class where applicable.
if ( $menu_items_with_children ) {
foreach ( $sorted_menu_items as &$menu_item ) {
if (
isset( $menu_items_with_children[
$menu_item->ID ] ) &&
( $args->depth <= 0 ||
$menu_items_with_children[ $menu_item->ID ] < $args->depth )
) {
$menu_item->classes[] = 'menu-item-has-
children';
}
}
}
unset( $menu_items_tree, $menu_items_with_children, $menu_items,
$menu_item );''
**Version wordpress 6.1.1**
What should i do?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57160>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list