Changeset 55059
- Timestamp:
- 01/12/2023 11:23:01 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu-template.php
r55005 r55059 199 199 $menu_items_with_children = array(); 200 200 foreach ( (array) $menu_items as $menu_item ) { 201 // Fix invalid `menu_item_parent`. See: https://core.trac.wordpress.org/ticket/56926. 202 if ( (int) $menu_item->ID === (int) $menu_item->menu_item_parent ) { 201 /* 202 * Fix invalid `menu_item_parent`. See: https://core.trac.wordpress.org/ticket/56926. 203 * Compare as strings. Plugins may change the ID to string. 204 * To avoid modifying the object, use `strval()` rather than casting to (string). 205 */ 206 if ( strval( $menu_item->ID ) === strval( $menu_item->menu_item_parent ) ) { 203 207 $menu_item->menu_item_parent = 0; 204 208 }
Note: See TracChangeset
for help on using the changeset viewer.