Menu API enhancements#2517
Conversation
gchtr
left a comment
There was a problem hiding this comment.
I think you’re way deeper into the menu logic than I will ever be. Thanks a lot for all your work! There’s lots of optimizations in there. I also like the part about the caching compatibility with other plugins.
I saw a couple of things that I think we discussed before. I added comments right in the code.
gchtr
left a comment
There was a problem hiding this comment.
I don’t want to keep this back much longer. There are lots of good things in here. I take three todos out of this:
- I’d like to just leave in the pages menu logic and refactor it with a separate issue (#2292).
- Then there’s the idea about the feature parity with
wp_nav_menu(), which we found is quite hard to accomplish. A separate method that builds a menu using the nav menu walker is quite a good idea for people who need to use it for compatibility reasons (see #2517 (comment)). - And finally, to return
nullinstead offalsefrom the factory methods so that they work with the null coalescing operator.
Once all the tests go green we can merge this in. Thank you so much for your work @nlemoine. Tell me if you still find the time to get this pull request ready more merging or if you’d like to pass it on.
|
Just want to flag the two failing tests we have remaining ... |
… 2.x-menu-enhancements
Co-authored-by: Lukas Gächter <[email protected]>
- Add classmap to `MenuItemFactory` - Don't return a menu when no `$params` are passed to `MenuFactory::from()`
gchtr
left a comment
There was a problem hiding this comment.
Nice, thanks for the additional updates @nlemoine. I like the new timber/menuitem/classmap filter 💪. And good catch with the assertInstanceOf() checks. I added two more issues to finish work on these in #2571 and #2572.
For me, the only remaining discussion is in #2517 (comment). Apart from that it would be nice if we could merge this in, soon.
If you want to add additional features, I think it would be nice to add it in a separate pull request. I think it’s better to have many smaller pull requests instead of having one big pull request that keeps growing and growing.
|
Oh, and #2517 (comment) is also unfinished 🙂. Do we want to move that to a separate issue as well, or do you want to solve it here, @nlemoine? |
…needed filters - Remove `MenuItem->__title`
… 2.x-menu-enhancements
|
@gchtr I think we're finally good on menus 😅 Please check my comment here: #2517 (comment) for the |
|
Do I still need to wait for @jarednova approval? |
|
@nlemoine No, I think Jared would have commented already earlier in the process if he saw something. You can merge it in 🎉. Thanks for your work on this! |
|
Yeah! 🥳 |
No description provided.