[wp-hackers] wp_nav_menu too simplistic?

Otto otto at ottodestruct.com
Tue Apr 6 21:31:21 UTC 2010

On Tue, Apr 6, 2010 at 4:22 PM, John Bloch <jbloch at olympianetworks.com> wrote:
> @Otto: Fair enough. I agree that it should have been built differently to
> begin with. But I think extending the walker class is an acceptable amount
> of work for the desired effect, given that's how it *has* been built.
> What exactly can't you modify by extending the walker and putting your own
> hooks in?

You can't make two separate, independent, plugins that both create new
types of menu items without mutual collaboration. Plugins should be
easily compatible with each other by the very nature of the core

I have no problem with a feature left out of the core, because I can
write plugins to add that feature easily enough. But if somebody else
wants to do the same and we step on each other, then it makes things
very annoying for our users.

On Tue, Apr 6, 2010 at 4:24 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
>> > 2. The ability to say "I want all children X levels deep included as menu
>> > item children of this page/category", i.e. dynamic child handling.
>> Yes, this is the only thing I'm interested in, and the lack of it
>> makes the new menu system basically useless to me. I'm stuck
>> hardcoding my menus instead. Very disappointing, as the feature does
>> have promise.
> It could be handled simply as an option of any menu item. Then the walker
> would need to know to fetch children X deep when it sees that option. Again,
> at the end of the day, someone needs to go code it.

Still seems very limiting. What if I want to have the menu item fetch
something entirely different, maybe display post links or something?
Or items from an RSS feed? Think wider, menu items don't have to be a
link to a URL only.

The whole thing is just very hardcoded and I'm unhappy about that
general design. I do grant you that it's still being worked on, and
yes, maybe it will improve.

My ideal would be basically just like the widgets. I could do class
My_Menu_Item extends Menu_Item_Widget, then define the configuration
page and its params and then have an output() function to output the
menu item from those params. Simple.


More information about the wp-hackers mailing list