[wp-trac] [WordPress Trac] #14142: Custom Walker class for navigation menus

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 29 14:16:19 UTC 2010


#14142: Custom Walker class for navigation menus
---------------------------+------------------------------------------------
 Reporter:  dennis.winter  |       Owner:                 
     Type:  defect (bug)   |      Status:  new            
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Menus          |     Version:  3.0            
 Severity:  major          |    Keywords:  has-patch      
---------------------------+------------------------------------------------
 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

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14142>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list