Changes between Initial Version and Version 1 of Ticket #57169, comment 10
- Timestamp:
- 01/05/2023 10:07:24 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #57169, comment 10
initial v1 9 9 Looking at Polylang (https://github.com/polylang/polylang/blob/3.3/frontend/frontend-nav-menu.php#L134), the language code is appended to `$menu_item->ID` and it becomes a string, but `$menu_item->menu_item_parent` is not changed/remains numeric. So using `intval()` reverts the $menu_item->ID back to being numeric and it can be compared to menu_item_parent. 10 10 11 I may be missing something but thinking this is the desired behaviour. Or does Polylang also append the language code to the `$menu_item->menu_item_parent`? 11 I may be missing something but thinking this is the desired behaviour. 12 13 Edit: ah, scratch that, think I see what's going on. When appending the language codes Polylang also may overwrite `$menu_item->menu_item_parent` to be the same as the initial `$menu_item->ID`. In that case comparing would be best as strings. 14