In the default WP_Nav_Menu walker, the current_object_id is not automatically populated while traversing menu items, leading to it being retrieved as 0 for all elements.
The design choice in WordPress' Walker_Nav_Menu appears to prioritize simplicity, leaving advanced use cases—like utilizing current_object_id—up to developers to customize for complex requirements.
Collection
[
|
...
]