Log1x / navi

A developer-friendly alternative to the WordPress NavWalker.
https://github.com/Log1x/navi
MIT License
311 stars 29 forks source link

fix(menu-builder): prevents endless recurtion with Polylang plugin #45

Closed felly closed 1 year ago

felly commented 3 years ago

Polylang uses the same IDs on dropdown menus as the parent - just with a suffix:

    +"id": "343-en"
    +"label": "EN"
    +"objectId": "343"
    +"parent": 343

This caused an endless recursion with the old comparison.

fixes #11

Log1x commented 1 year ago

I'm not seeing any recursion in the current version of Polylang. I added multiple language switchers to the navigation successfully with dropdown enabled while having multiple languages. I do see what you're talking about with the ID's, but I am not seeing any side-effects to this.

Feel free to re-open if you can give me a way to reproduce this.