Custom Walker class for navigation menus
|Reported by:||dennis.winter||Owned by:|
I have tried to extend the Walker_Nav_Menu class, I just needed to overwrite the start_el method. So i added "walker"=>"My_Walker" to wp_nav_menu, I've got an error message, that the method "walk" could not be accessed statically. After a short look at the code in "nav-menu-template", I realized that in the method "walk_nav_menu_tree" the object initializer "new" is missing.
My solution can be found in the attached file.
As you can see, I've just added a "new" in front of $r->walker
And it works
Change History (7)
- Keywords has-patch removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Severity changed from major to normal
- Status changed from new to closed